<!doctype html public "-//W3C//DTD HTML 4.0 Frameset//EN""http://www.w3.org/TR/REC-html40/frameset.dtd">
<html>
<head>
<title>
Zapatec Utils Overview
</title>
<link rel ="stylesheet" type="text/css" href="stylesheet.css" title="Style">
<script>
function asd() {
	
		parent.document.title="zptabs.js Overview";
	
}
</script>
</head>
<body bgcolor="white" onload="asd();">

<!-- ========== START OF NAVBAR ========== -->
<a name="navbar_top"><!-- --></a>
<table border="0" width="100%" cellpadding="1" cellspacing="0">
<tr>
<td colspan=2 bgcolor="#EEEEFF" class="NavBarCell1">
<a name="navbar_top_firstrow"><!-- --></a>
<table border="0" cellpadding="0" cellspacing="3">
  <tr align="center" valign="top">
  
  
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="overview-summary.html"><font class="NavBarFont1"><b>Overview</b></font></a>&nbsp;</td>
  <td bgcolor="#FFFFFF" class="NavBarCell1Rev">	&nbsp;<font class="NavBarFont1Rev"><b>File</b></font>&nbsp;</td>
  

  <td bgcolor="#FFFFFF" class="NavBarCell1"> 	<font class="NavBarFont1">Class</font>&nbsp;</td>
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="overview-tree.html"><font class="NavBarFont1"><b>Tree</b></font></a>&nbsp;</td>
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="index-all.html"--><font class="NavBarFont1"><b>Index</b></font></a>&nbsp;</td>
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="help-doc.html"><font class="NavBarFont1"><b>Help</b></font></a>&nbsp;</td>
  </tr>
</table>
</td>
<td bgcolor="#EEEEFF" align="right" valign="top">
<em>
<b>Zapatec Utils</b></em>
</td>
</tr>

<tr>
<td bgcolor="white" class="NavBarCell2"><font size="-2">
&nbsp;PREV&nbsp;
&nbsp;NEXT</font></td>
<td bgcolor="white" class="NavBarCell2"><font size="-2">
  <a href="index.html" target="_top"><b>FRAMES</b></a>  &nbsp;
&nbsp;<a href="overview-summary.html" target="_top"><b>NO FRAMES</b></a>
&nbsp;&nbsp;
<script>
  <!--
  if(window==top) {
    document.writeln('<A HREF="allclasses-noframe.html" TARGET=""><B>All Classes</B></A>');
  }
  //-->
</script>
<noscript>
<a href="allclasses-noframe.html" target=""><b>All Classes</b></a>
</noscript>
</font></td>
</tr>
</table>
<!-- =========== END OF NAVBAR =========== -->

<hr>
<center>
	
	   <h2>zptabs.js</h2>
	
</center>

	


<h4>Summary</h4>
<p>
	
		No overview generated for 'zptabs.js'<BR/><BR/>
	
</p>

<hr>


    <table border="1" cellpadding="3" cellspacing="0" width="100%">
    <tr bgcolor="#CCCCFF" class="TableHeadingColor">
    <td colspan=2><font size="+2">
    
        <b>Class Summary</b>
    
    </font></td>
    </tr>
    
    <tr bgcolor="white" class="TableRowColor">
    <td width="15%"><b><a href="Zapatec/AccordionTab.html">Zapatec.AccordionTab</a></b></td>
    <td>&nbsp;</td>
    </tr>
    
    <tr bgcolor="white" class="TableRowColor">
    <td width="15%"><b><a href="Zapatec/AccordionTabs.html">Zapatec.AccordionTabs</a></b></td>
    <td>&nbsp;</td>
    </tr>
    
    <tr bgcolor="white" class="TableRowColor">
    <td width="15%"><b><a href="Zapatec/Tab.html">Zapatec.Tab</a></b></td>
    <td>&nbsp;</td>
    </tr>
    
    <tr bgcolor="white" class="TableRowColor">
    <td width="15%"><b><a href="Zapatec/Tabs.html">Zapatec.Tabs</a></b></td>
    <td>&nbsp;</td>
    </tr>
    
    <tr bgcolor="white" class="TableRowColor">
    <td width="15%"><b><a href="Zapatec/TabsWizard.html">Zapatec.TabsWizard</a></b></td>
    <td>&nbsp;</td>
    </tr>
    
    </table>
    <hr/> 


<!-- ========== METHOD SUMMARY =========== -->

<!-- ========== END METHOD SUMMARY =========== -->


        <pre class="sourceview"><span class="comment">/*
 *
 * Copyright (c) 2004-2009 by Zapatec, Inc.
 * http://www.zapatec.com
 * 1700 MLK Way, Berkeley, California,
 * 94709, U.S.A.
 * All rights reserved.
 *
 *
 */</span>
Zapatec.tabsPath = Zapatec.getPath(<span class="literal">"Zapatec.TabsWidget"</span>);

Zapatec.Utils.createNestedHash(Zapatec,[<span class="literal">"Langs"</span>,<span class="literal">"Zapatec.Tabs"</span>,<span class="literal">"eng"</span>],{<span class="literal">'unknownTabBarError'</span>:<span class="literal">'Can\'</span>t find container <span class="reserved">for</span> tab bar (<span class="literal">"tabBar"</span> config option)<span class="literal">','</span>unknownTabsError<span class="literal">':'</span>Can\<span class="literal">'t find container for tab contents ("tabs" config option)'</span>,<span class="literal">'unknownTabParentError'</span>:<span class="literal">'No reference to tab parent!'</span>});Zapatec.Modal=<span class="reserved">function</span>(config){<span class="reserved">if</span>(arguments.length==0){config={};}
<span class="reserved">this</span>.visible=false;Zapatec.Modal.SUPERconstructor.call(<span class="reserved">this</span>,config);}
Zapatec.Modal.id=<span class="literal">"Zapatec.Indicator"</span>;Zapatec.inherit(Zapatec.Modal,Zapatec.Widget);Zapatec.Modal.<span class="reserved">prototype</span>.init=<span class="reserved">function</span>(config){Zapatec.Modal.SUPERclass.init.call(<span class="reserved">this</span>,config);};Zapatec.Modal.<span class="reserved">prototype</span>.configure=<span class="reserved">function</span>(config){<span class="reserved">this</span>.defineConfigOption(<span class="literal">"zIndex"</span>,1000);<span class="reserved">this</span>.defineConfigOption(<span class="literal">"x"</span>,null);<span class="reserved">this</span>.defineConfigOption(<span class="literal">"y"</span>,null);<span class="reserved">this</span>.defineConfigOption(<span class="literal">"width"</span>,null);<span class="reserved">this</span>.defineConfigOption(<span class="literal">"height"</span>,null);<span class="reserved">this</span>.defineConfigOption(<span class="literal">"container"</span>,window);<span class="reserved">this</span>.defineConfigOption(<span class="literal">"fixed"</span>,false);<span class="reserved">this</span>.defineConfigOption(<span class="literal">"themePath"</span>,Zapatec.zapatecPath+<span class="literal">"../zpextra/themes/indicator/"</span>);Zapatec.Modal.SUPERclass.configure.call(<span class="reserved">this</span>,config);config=<span class="reserved">this</span>.getConfiguration();<span class="reserved">if</span>(config.container!=window){config.x=null;config.y=null;config.width=null;config.height=null;config.fixed=false;}};Zapatec.Modal.<span class="reserved">prototype</span>.create=<span class="reserved">function</span>(){var config=<span class="reserved">this</span>.getConfiguration();config.container=Zapatec.Widget.getElementById(config.container)||window;<span class="reserved">this</span>.WCH=Zapatec.Utils.createWCH();<span class="reserved">if</span>(Zapatec.is_ie&amp;&amp;!Zapatec.Utils.isWindowLoaded()&amp;&amp;document.readyState!=<span class="literal">'interactive'</span>){document.write(<span class="literal">'&lt;div id="zpModalContainer"&gt;&lt;/div&gt;'</span>);<span class="reserved">this</span>.container=document.getElementById(<span class="literal">'zpModalContainer'</span>);}<span class="reserved">else</span>{<span class="reserved">this</span>.container=Zapatec.Utils.createElement(<span class="literal">"div"</span>,document.body);}
<span class="reserved">this</span>.container.className=<span class="reserved">this</span>.getClassName({prefix:<span class="literal">"zpModal"</span>+(Zapatec.is_opera?<span class="literal">"Opera"</span>:<span class="literal">""</span>)})
var st=<span class="reserved">this</span>.container.style;st.display=<span class="literal">"none"</span>;st.position=<span class="literal">"absolute"</span>;st.zIndex=config.zIndex;};Zapatec.Modal.<span class="reserved">prototype</span>.show=<span class="reserved">function</span>(zIndex){<span class="reserved">if</span>(!<span class="reserved">this</span>.container){<span class="reserved">this</span>.create();}
zIndex=zIndex||<span class="reserved">this</span>.config.zIndex;<span class="reserved">this</span>.container.style.zIndex=zIndex;<span class="reserved">if</span>(<span class="reserved">this</span>.WCH){<span class="reserved">this</span>.WCH.style.visibility=<span class="literal">""</span>;<span class="reserved">this</span>.WCH.style.zIndex=zIndex-1;}
<span class="reserved">this</span>.container.style.display=<span class="literal">"block"</span>;<span class="reserved">this</span>.visible=true;var config=<span class="reserved">this</span>.getConfiguration();<span class="reserved">if</span>(config.container!=window){var self=<span class="reserved">this</span>;var update=<span class="reserved">function</span>(){self.update();}
<span class="reserved">if</span>(!<span class="reserved">this</span>.interval){<span class="reserved">this</span>.interval=setInterval(update,100);}
<span class="reserved">this</span>.update();}<span class="reserved">else</span>{var dim=Zapatec.Utils.getWindowSize();var width=config.width||dim.width;var height=config.height||dim.height;var x=config.x||Zapatec.Utils.getPageScrollX();var y=config.y||Zapatec.Utils.getPageScrollY();<span class="reserved">this</span>.setWidth(width);<span class="reserved">this</span>.setHeight(height);<span class="reserved">this</span>.setPosition(x,y);}
<span class="reserved">if</span>(<span class="reserved">this</span>.config.fixed==true){Zapatec.FixateOnScreen.register(<span class="reserved">this</span>.container);<span class="reserved">if</span>(<span class="reserved">this</span>.WCH){Zapatec.FixateOnScreen.register(<span class="reserved">this</span>.WCH);}}};Zapatec.Modal.<span class="reserved">prototype</span>.update=<span class="reserved">function</span>(){var config=<span class="reserved">this</span>.getConfiguration();<span class="reserved">if</span>(config.container!=window&amp;&amp;<span class="reserved">this</span>.visible){var offs=Zapatec.Utils.getElementOffset(config.container);<span class="reserved">this</span>.setWidth(offs.width);<span class="reserved">this</span>.setHeight(offs.height);<span class="reserved">this</span>.setPosition(offs.x,offs.y);}};Zapatec.Modal.<span class="reserved">prototype</span>.hide=<span class="reserved">function</span>(destroy){var config=<span class="reserved">this</span>.getConfiguration();<span class="reserved">if</span>(!config){<span class="reserved">return</span>;}
<span class="reserved">if</span>(config.fixed==true){Zapatec.FixateOnScreen.unregister(<span class="reserved">this</span>.container);<span class="reserved">if</span>(<span class="reserved">this</span>.WCH){Zapatec.FixateOnScreen.unregister(<span class="reserved">this</span>.WCH);}}
<span class="reserved">if</span>(config.container!=window){clearInterval(<span class="reserved">this</span>.interval);<span class="reserved">this</span>.interval=null;}
<span class="reserved">if</span>(<span class="reserved">this</span>.container)<span class="reserved">this</span>.container.style.display=<span class="literal">"none"</span>;Zapatec.Utils.hideWCH(<span class="reserved">this</span>.WCH);<span class="reserved">if</span>(destroy){<span class="reserved">if</span>(<span class="reserved">this</span>.WCH){<span class="reserved">if</span>(<span class="reserved">this</span>.WCH.outerHTML){<span class="reserved">this</span>.WCH.outerHTML=<span class="literal">""</span>;}<span class="reserved">else</span>{Zapatec.Utils.destroy(<span class="reserved">this</span>.WCH);}}
<span class="reserved">if</span>(<span class="reserved">this</span>.container.outerHTML){<span class="reserved">this</span>.container.outerHTML=<span class="literal">""</span>;}<span class="reserved">else</span>{Zapatec.Utils.destroy(<span class="reserved">this</span>.container);}
<span class="reserved">this</span>.WCH=null;<span class="reserved">this</span>.container=null;}
<span class="reserved">this</span>.visible=false;};Zapatec.Modal.<span class="reserved">prototype</span>.setWidth=<span class="reserved">function</span>(width){<span class="reserved">if</span>(!<span class="reserved">this</span>.container){<span class="reserved">return</span>;}
<span class="reserved">if</span>(Zapatec.Utils.setWidth){Zapatec.Utils.setWidth(<span class="reserved">this</span>.container,width);Zapatec.Utils.setWidth(<span class="reserved">this</span>.WCH,width);}<span class="reserved">else</span>{<span class="reserved">this</span>.container.style.width=width+<span class="literal">"px"</span>;<span class="reserved">if</span>(<span class="reserved">this</span>.WCH){<span class="reserved">this</span>.WCH.style.width=width+<span class="literal">"px"</span>;}}};Zapatec.Modal.<span class="reserved">prototype</span>.setHeight=<span class="reserved">function</span>(height){<span class="reserved">if</span>(!<span class="reserved">this</span>.container){<span class="reserved">return</span>;}
<span class="reserved">if</span>(Zapatec.Utils.setHeight){Zapatec.Utils.setHeight(<span class="reserved">this</span>.container,height);Zapatec.Utils.setHeight(<span class="reserved">this</span>.WCH,height);}<span class="reserved">else</span>{<span class="reserved">this</span>.container.style.height=height+<span class="literal">"px"</span>;<span class="reserved">if</span>(<span class="reserved">this</span>.WCH){<span class="reserved">this</span>.WCH.style.height=height+<span class="literal">"px"</span>;}}};Zapatec.Modal.<span class="reserved">prototype</span>.setPosition=<span class="reserved">function</span>(x,y){<span class="reserved">if</span>(!<span class="reserved">this</span>.container){<span class="reserved">return</span>;}
<span class="reserved">if</span>(Zapatec.Utils.moveTo){Zapatec.Utils.moveTo(<span class="reserved">this</span>.container,x,y);Zapatec.Utils.moveTo(<span class="reserved">this</span>.WCH,x,y);}<span class="reserved">else</span>{<span class="reserved">this</span>.container.style.left=x+<span class="literal">"px"</span>;<span class="reserved">this</span>.container.style.top=y+<span class="literal">"px"</span>;<span class="reserved">if</span>(<span class="reserved">this</span>.WCH){<span class="reserved">this</span>.WCH.style.left=x+<span class="literal">"px"</span>;<span class="reserved">this</span>.WCH.style.top=y+<span class="literal">"px"</span>;}}};Zapatec.Indicator=<span class="reserved">function</span>(config){<span class="reserved">if</span>(arguments.length==0){config={};}
<span class="reserved">this</span>.active=false;Zapatec.Indicator.SUPERconstructor.call(<span class="reserved">this</span>,config);}
Zapatec.Indicator.id=<span class="literal">"Zapatec.Indicator"</span>;Zapatec.inherit(Zapatec.Indicator,Zapatec.Modal);Zapatec.Indicator.<span class="reserved">prototype</span>.init=<span class="reserved">function</span>(config){Zapatec.Indicator.SUPERclass.init.call(<span class="reserved">this</span>,config);};Zapatec.Indicator.<span class="reserved">prototype</span>.configure=<span class="reserved">function</span>(config){<span class="reserved">this</span>.defineConfigOption(<span class="literal">"themePath"</span>,Zapatec.zapatecPath+<span class="literal">"../zpextra/themes/indicator/"</span>);Zapatec.Indicator.SUPERclass.configure.call(<span class="reserved">this</span>,config);};Zapatec.Indicator.<span class="reserved">prototype</span>.create=<span class="reserved">function</span>(){Zapatec.Indicator.SUPERclass.create.call(<span class="reserved">this</span>);<span class="reserved">this</span>.indicator=Zapatec.Utils.createElement(<span class="literal">"div"</span>,<span class="reserved">this</span>.container);<span class="reserved">this</span>.indicator.className=<span class="literal">"zpIndicator"</span>;var st=<span class="reserved">this</span>.indicator.style;st.position=<span class="literal">"absolute"</span>;st.zIndex=<span class="reserved">this</span>.getConfiguration().zIndex;st.backgroundColor=<span class="literal">"#aaaaaa"</span>;};Zapatec.Indicator.<span class="reserved">prototype</span>.setWidth=<span class="reserved">function</span>(width){<span class="reserved">if</span>(!<span class="reserved">this</span>.container){<span class="reserved">return</span>;}
Zapatec.Indicator.SUPERclass.setWidth.call(<span class="reserved">this</span>,width);var left=Math.round((<span class="reserved">this</span>.container.offsetWidth-<span class="reserved">this</span>.indicator.offsetWidth)/2);<span class="reserved">this</span>.indicator.style.left=left+<span class="literal">"px"</span>;};Zapatec.Indicator.<span class="reserved">prototype</span>.setHeight=<span class="reserved">function</span>(height){<span class="reserved">if</span>(!<span class="reserved">this</span>.container){<span class="reserved">return</span>;}
Zapatec.Indicator.SUPERclass.setHeight.call(<span class="reserved">this</span>,height);var top=Math.round((<span class="reserved">this</span>.container.offsetHeight-<span class="reserved">this</span>.indicator.offsetHeight)/2);<span class="reserved">this</span>.indicator.style.top=top+<span class="literal">"px"</span>;};Zapatec.Indicator.<span class="reserved">prototype</span>.hide=<span class="reserved">function</span>(destroy){<span class="reserved">if</span>(destroy){<span class="reserved">this</span>.indicator=null;}
Zapatec.Indicator.SUPERclass.hide.call(<span class="reserved">this</span>,destroy);};Zapatec.Indicator.<span class="reserved">prototype</span>.start=<span class="reserved">function</span>(message){<span class="reserved">this</span>.active=true;<span class="reserved">if</span>(!<span class="reserved">this</span>.indicator){<span class="reserved">this</span>.create();}
<span class="reserved">this</span>.indicator.innerHTML=message;<span class="reserved">this</span>.show();};Zapatec.Indicator.<span class="reserved">prototype</span>.stop=<span class="reserved">function</span>(){<span class="reserved">this</span>.active=false;<span class="reserved">this</span>.hide(true);};Zapatec.Indicator.<span class="reserved">prototype</span>.isActive=<span class="reserved">function</span>(){<span class="reserved">return</span> <span class="reserved">this</span>.active;};Zapatec.Pane=<span class="reserved">function</span>(objArgs){<span class="reserved">this</span>.config={};<span class="reserved">if</span>(arguments.length==0){objArgs={};}
<span class="reserved">this</span>.widgetType=<span class="literal">"pane"</span>;<span class="reserved">this</span>.ready=false;<span class="reserved">this</span>.loading=false;<span class="reserved">this</span>.prepared=false;Zapatec.Utils.createProperty(<span class="reserved">this</span>,<span class="literal">"container"</span>,null);Zapatec.Utils.createProperty(<span class="reserved">this</span>,<span class="literal">"contentElement"</span>,null);Zapatec.Utils.createProperty(<span class="reserved">this</span>,<span class="literal">"iframeDocument"</span>,null);Zapatec.Pane.SUPERconstructor.call(<span class="reserved">this</span>,objArgs);}
Zapatec.Pane.id=<span class="literal">"Zapatec.Pane"</span>;Zapatec.inherit(Zapatec.Pane,Zapatec.Widget);Zapatec.Pane.<span class="reserved">prototype</span>.init=<span class="reserved">function</span>(objArgs){Zapatec.Utils.createProperty(<span class="reserved">this</span>.config,<span class="literal">"parent"</span>,document.body);<span class="reserved">this</span>.config.theme=null;<span class="reserved">this</span>.config.width=null;<span class="reserved">this</span>.config.height=null;<span class="reserved">this</span>.config.containerType=<span class="literal">"div"</span>;<span class="reserved">this</span>.config.sourceType=null;<span class="reserved">this</span>.config.source=null;<span class="reserved">this</span>.config.autoContentWidth=false;<span class="reserved">this</span>.config.autoContentHeight=false;<span class="reserved">this</span>.config.onlyInit=false;<span class="reserved">this</span>.config.showLoadingIndicator=true;<span class="reserved">this</span>.config.overflow=<span class="literal">"auto"</span>;<span class="reserved">this</span>.config.iframeScrolling=null;<span class="reserved">this</span>.config.removeBorder=false;<span class="reserved">this</span>.config.id=null;Zapatec.Pane.SUPERclass.init.call(<span class="reserved">this</span>,objArgs);<span class="reserved">if</span>(<span class="reserved">this</span>.config.containerType==null){<span class="reserved">this</span>.config.containerType=<span class="literal">"div"</span>;}
<span class="reserved">if</span>(!<span class="reserved">this</span>.config.onlyInit){<span class="reserved">this</span>.create(<span class="reserved">this</span>.config.width,<span class="reserved">this</span>.config.height);}
var self=<span class="reserved">this</span>;<span class="reserved">function</span> update(){<span class="reserved">if</span>(self.loader){self.loader.update();}}
<span class="reserved">this</span>.addEventListener(<span class="literal">"fetchSourceStart"</span>,update);<span class="reserved">this</span>.addEventListener(<span class="literal">"fetchSourceEnd"</span>,update);}
Zapatec.Pane.<span class="reserved">prototype</span>.prepareHtml=<span class="reserved">function</span>(){<span class="reserved">if</span>(<span class="reserved">this</span>.config.containerType.toLowerCase()==<span class="literal">'iframe'</span>){var iframe=document.createElement(<span class="literal">"iframe"</span>);<span class="reserved">if</span>(<span class="reserved">this</span>.config.iframeScrolling){iframe.scrolling=<span class="reserved">this</span>.config.iframeScrolling;}
iframe.src=Zapatec.zapatecPath+<span class="literal">"pane_files/blank.html#"</span>+<span class="reserved">this</span>.id;<span class="reserved">this</span>.container=iframe;iframe=null;}<span class="reserved">else</span> <span class="reserved">if</span>(<span class="reserved">this</span>.config.containerType.toLowerCase()==<span class="literal">'div'</span>){<span class="reserved">this</span>.container=document.createElement(<span class="literal">"div"</span>);<span class="reserved">if</span>(<span class="reserved">this</span>.config.id){<span class="reserved">this</span>.container.id=<span class="reserved">this</span>.config.id;}
<span class="reserved">this</span>.contentElement=<span class="reserved">this</span>.container;}<span class="reserved">else</span> <span class="reserved">if</span>(<span class="reserved">this</span>.config.parent&amp;&amp;<span class="reserved">this</span>.config.parent.nodeType==1){<span class="reserved">this</span>.container=<span class="reserved">this</span>.config.parent;<span class="reserved">this</span>.contentElement=<span class="reserved">this</span>.container;}
<span class="reserved">this</span>.prepared=true;<span class="reserved">if</span>(<span class="reserved">this</span>.config.removeBorder){<span class="reserved">this</span>.removeBorder();}};Zapatec.Pane.<span class="reserved">prototype</span>.create=<span class="reserved">function</span>(width,height){<span class="reserved">if</span>(!<span class="reserved">this</span>.prepared){<span class="reserved">this</span>.prepareHtml();}
<span class="reserved">if</span>(!(<span class="reserved">this</span>.config.parent=Zapatec.Widget.getElementById(<span class="reserved">this</span>.config.parent))){Zapatec.Log({description:<span class="literal">"No reference to parent element."</span>});<span class="reserved">return</span> null;}
<span class="reserved">if</span>(<span class="reserved">this</span>.config.parent.requestParentFor&amp;&amp;!(<span class="reserved">this</span>.config.parent=<span class="reserved">this</span>.config.parent.requestParentFor(<span class="reserved">this</span>))){Zapatec.Log({description:<span class="literal">"No reference to parent element after request to the Parent Widget!"</span>});<span class="reserved">return</span> null;}
<span class="reserved">if</span>(<span class="reserved">this</span>.config.containerType.toLowerCase()==<span class="literal">'div'</span>||<span class="reserved">this</span>.config.containerType.toLowerCase()==<span class="literal">'iframe'</span>){<span class="reserved">this</span>.ready=false;<span class="reserved">this</span>.config.parent.appendChild(<span class="reserved">this</span>.container);<span class="reserved">if</span>(<span class="reserved">this</span>.config.containerType.toLowerCase()!=<span class="literal">'iframe'</span>){<span class="reserved">this</span>.initPane();}}<span class="reserved">else</span> <span class="reserved">if</span>(<span class="reserved">this</span>.config.containerType.toLowerCase()==<span class="literal">'current'</span>){<span class="reserved">this</span>.container=<span class="reserved">this</span>.config.parent;<span class="reserved">this</span>.contentElement=<span class="reserved">this</span>.container;<span class="reserved">this</span>.initPane();}<span class="reserved">else</span>{Zapatec.Log({description:<span class="literal">"Unknown container type: "</span>+<span class="reserved">this</span>.config.containerType+<span class="literal">". Possible values: iframe|div"</span>})}
Zapatec.Utils.addClass(<span class="reserved">this</span>.container,<span class="reserved">this</span>.getClassName({prefix:<span class="literal">"zpPane"</span>}));<span class="reserved">if</span>(width||<span class="reserved">this</span>.config.width){<span class="reserved">this</span>.setWidth(width||<span class="reserved">this</span>.config.width);}
<span class="reserved">if</span>(height||<span class="reserved">this</span>.config.height){<span class="reserved">this</span>.setHeight(height||<span class="reserved">this</span>.config.height);}
<span class="reserved">this</span>.getContainer().style.display=<span class="literal">"block"</span>;<span class="reserved">this</span>.setPaneContent();};Zapatec.Pane.<span class="reserved">prototype</span>.initPane=<span class="reserved">function</span>(){<span class="reserved">if</span>(<span class="reserved">this</span>.config.containerType.toLowerCase()==<span class="literal">'iframe'</span>){var doc=null;var sameDomain=true;var url=<span class="reserved">this</span>.container.src;var anchorEl=document.createElement(<span class="literal">"a"</span>);var protocolSeparatorPos=url.indexOf(<span class="literal">"://"</span>);<span class="reserved">if</span>(protocolSeparatorPos!=-1){var domainSeparatorPos=url.indexOf(<span class="literal">"/"</span>,protocolSeparatorPos+3);var domain=url.substring((protocolSeparatorPos&gt;0?protocolSeparatorPos+3:0),(domainSeparatorPos&gt;0?domainSeparatorPos:url.length));<span class="reserved">if</span>(domain!=window.location.host){sameDomain=false;}}
<span class="reserved">if</span>(sameDomain){<span class="reserved">if</span>(<span class="reserved">this</span>.container.contentDocument!=null){doc=<span class="reserved">this</span>.container.contentDocument;}<span class="reserved">else</span> <span class="reserved">if</span>(<span class="reserved">this</span>.container.contentWindow&amp;&amp;<span class="reserved">this</span>.container.contentWindow.document!=null){doc=<span class="reserved">this</span>.container.contentWindow.document;}
var self=<span class="reserved">this</span>;anchorEl.href=url;url=anchorEl.href;<span class="reserved">if</span>(doc==null||doc.body==null||(Zapatec.is_gecko&amp;&amp;url!=<span class="reserved">this</span>.container.contentWindow.location.href)){setTimeout(<span class="reserved">function</span>(){self.initPane()},50);<span class="reserved">return</span> false;}
<span class="reserved">this</span>.iframeDocument=doc;<span class="reserved">this</span>.contentElement=doc.body;<span class="reserved">if</span>(typeof <span class="reserved">this</span>.container.contentWindow.Zapatec!=<span class="literal">"object"</span>&amp;&amp;typeof <span class="reserved">this</span>.container.contentWindow.Zapatec!=<span class="literal">"function"</span>){<span class="reserved">this</span>.container.contentWindow.Zapatec={};<span class="reserved">this</span>.container.contentWindow.Zapatec.windowLoaded=typeof(doc.readyState)!=<span class="literal">'undefined'</span>?(doc.readyState==<span class="literal">'loaded'</span>||doc.readyState==<span class="literal">'complete'</span>):doc.getElementsByTagName!=null&amp;&amp;typeof(doc.getElementsByTagName(<span class="literal">'body'</span>)[0])!=<span class="literal">'undefined'</span>;Zapatec.Utils.addEvent(<span class="reserved">this</span>.container.contentWindow,<span class="literal">"load"</span>,<span class="reserved">function</span>(){self.container.contentWindow.Zapatec.windowLoaded=true;},false,false);}
<span class="reserved">if</span>(!<span class="reserved">this</span>.container.contentWindow.Zapatec||!<span class="reserved">this</span>.container.contentWindow.Zapatec.windowLoaded){setTimeout(<span class="reserved">function</span>(){self.initPane()},50);<span class="reserved">return</span> false;}
doc=null;}}
<span class="reserved">if</span>(<span class="reserved">this</span>.config.overflow){<span class="reserved">this</span>.getContainer().style.overflow=<span class="reserved">this</span>.config.overflow;}
<span class="reserved">this</span>.ready=true;<span class="reserved">this</span>.fireEvent(<span class="literal">"onReady"</span>,<span class="reserved">this</span>);<span class="reserved">this</span>.hideIndicator();<span class="reserved">this</span>.loading=false;<span class="reserved">this</span>.removeEvent(<span class="literal">"onReady"</span>);}
Zapatec.Pane.<span class="reserved">prototype</span>.getContainer=<span class="reserved">function</span>(){<span class="reserved">return</span> <span class="reserved">this</span>.container;}
Zapatec.Pane.<span class="reserved">prototype</span>.getIframeDocument=<span class="reserved">function</span>(){<span class="reserved">return</span> <span class="reserved">this</span>.iframeDocument;}
Zapatec.Pane.<span class="reserved">prototype</span>.getContentElement=<span class="reserved">function</span>(){<span class="reserved">return</span> <span class="reserved">this</span>.contentElement;}
Zapatec.Pane.<span class="reserved">prototype</span>.isReady=<span class="reserved">function</span>(){<span class="reserved">return</span> <span class="reserved">this</span>.ready;}
Zapatec.Pane.<span class="reserved">prototype</span>.loadDataJson=<span class="reserved">function</span>(objSource){<span class="reserved">return</span> objSource!=null?<span class="reserved">this</span>.setContent(objSource.content):null;}
Zapatec.Pane.<span class="reserved">prototype</span>.setContent=<span class="reserved">function</span>(content){<span class="reserved">if</span>(!<span class="reserved">this</span>.isReady()){var self=<span class="reserved">this</span>;setTimeout(<span class="reserved">function</span>(){self.setContent(content)},50);<span class="reserved">return</span> null;}
<span class="reserved">this</span>.loading=false;<span class="reserved">if</span>(!<span class="reserved">this</span>.getContentElement()){<span class="reserved">this</span>.hideIndicator();<span class="reserved">return</span> false;}
<span class="reserved">if</span>(content===null){<span class="reserved">this</span>.hideIndicator();<span class="reserved">return</span> null;}<span class="reserved">else</span>{<span class="reserved">if</span>(<span class="reserved">this</span>.config.containerType.toLowerCase()!=<span class="literal">"iframe"</span>){var oldOverflow=<span class="reserved">this</span>.getContainer().style.overflow;<span class="reserved">if</span>(<span class="reserved">this</span>.config.autoContentWidth){<span class="reserved">this</span>.getContainer().style.overflow=<span class="literal">"visible"</span>;<span class="reserved">this</span>.getContainer().style.width=<span class="literal">"auto"</span>;}
<span class="reserved">if</span>(<span class="reserved">this</span>.config.autoContentHeight){<span class="reserved">this</span>.getContainer().style.overflow=<span class="literal">"visible"</span>;<span class="reserved">this</span>.getContainer().style.height=<span class="literal">"auto"</span>;}}
<span class="reserved">if</span>(typeof(content)==<span class="literal">'string'</span>){Zapatec.Transport.setInnerHtml({container:<span class="reserved">this</span>.getContentElement(),html:content});}<span class="reserved">else</span>{try{<span class="reserved">if</span>((Zapatec.is_ie||Zapatec.is_opera)&amp;&amp;<span class="reserved">this</span>.config.containerType.toLowerCase()==<span class="literal">"iframe"</span>){Zapatec.Transport.setInnerHtml({container:<span class="reserved">this</span>.getContentElement(),html:content.outerHTML});}<span class="reserved">else</span>{<span class="reserved">if</span>(content.parentNode!=<span class="reserved">this</span>.getContentElement()){<span class="reserved">this</span>.getContentElement().innerHTML=<span class="literal">""</span>;<span class="reserved">this</span>.getContentElement().appendChild(content);}}}catch(ex){<span class="reserved">this</span>.hideIndicator();<span class="reserved">return</span> null;}}
<span class="reserved">if</span>(<span class="reserved">this</span>.config.containerType.toLowerCase()!=<span class="literal">"iframe"</span>){var newWidth=<span class="reserved">this</span>.getWidth();var newHeight=<span class="reserved">this</span>.getHeight();}<span class="reserved">else</span>{var newWidth=<span class="reserved">this</span>.getContentElement().scrollWidth+5;var newHeight=<span class="reserved">this</span>.getContentElement().scrollHeight+5;}
<span class="reserved">if</span>(typeof oldOverflow!=<span class="literal">"undefined"</span>)<span class="reserved">this</span>.getContainer().style.overflow=oldOverflow;<span class="reserved">if</span>(<span class="reserved">this</span>.config.autoContentWidth){<span class="reserved">this</span>.setWidth(newWidth);}
<span class="reserved">if</span>(<span class="reserved">this</span>.config.autoContentHeight){<span class="reserved">this</span>.setHeight(newHeight);}}
<span class="reserved">this</span>.fireEvent(<span class="literal">"contentLoaded"</span>,<span class="reserved">this</span>);<span class="reserved">this</span>.hideIndicator();<span class="reserved">return</span> true;}
Zapatec.Pane.<span class="reserved">prototype</span>.loadDataHtml=Zapatec.Pane.<span class="reserved">prototype</span>.loadDataXml=Zapatec.Pane.<span class="reserved">prototype</span>.setContent;Zapatec.Pane.<span class="reserved">prototype</span>.loadDataHtmlText=<span class="reserved">function</span>(content){<span class="reserved">this</span>.setContent(content);};Zapatec.Pane.<span class="reserved">prototype</span>.setWidth=<span class="reserved">function</span>(width){var self=<span class="reserved">this</span>;<span class="reserved">this</span>.fireWhenReady(<span class="reserved">function</span>(){<span class="reserved">if</span>(width&gt;=0){self.getContainer().style.width=width+<span class="literal">"px"</span>;}
<span class="reserved">if</span>(self.getContainer().offsetWidth!=width){var newWidth=width-(self.getContainer().offsetWidth-width);<span class="reserved">if</span>(newWidth&lt;0)newWidth=0;self.getContainer().style.width=newWidth+<span class="literal">"px"</span>;}});}
Zapatec.Pane.<span class="reserved">prototype</span>.getWidth=<span class="reserved">function</span>(){<span class="reserved">return</span> <span class="reserved">this</span>.getContainer().offsetWidth;}
Zapatec.Pane.<span class="reserved">prototype</span>.setHeight=<span class="reserved">function</span>(height){var self=<span class="reserved">this</span>;<span class="reserved">this</span>.fireWhenReady(<span class="reserved">function</span>(){<span class="reserved">if</span>(height&gt;=0){self.getContainer().style.height=height+<span class="literal">"px"</span>;}
<span class="reserved">if</span>(self.getContainer().offsetHeight!=height){var newHeight=height-(self.getContainer().offsetHeight-height);<span class="reserved">if</span>(newHeight&lt;0)newHeight=0;self.getContainer().style.height=newHeight+<span class="literal">"px"</span>;}});}
Zapatec.Pane.<span class="reserved">prototype</span>.getHeight=<span class="reserved">function</span>(){<span class="reserved">return</span> <span class="reserved">this</span>.getContainer().offsetHeight;}
Zapatec.Pane.<span class="reserved">prototype</span>.removeBorder=<span class="reserved">function</span>(){<span class="reserved">if</span>(<span class="reserved">this</span>.config.containerType.toLowerCase()!=<span class="literal">"iframe"</span>){<span class="reserved">return</span> false;}
var self=<span class="reserved">this</span>;<span class="reserved">this</span>.fireWhenReady(<span class="reserved">function</span>(){<span class="reserved">if</span>(!Zapatec.is_ie){self.getContainer().style.border=<span class="literal">"none"</span>;}<span class="reserved">else</span>{<span class="reserved">if</span>(self.getContentElement()){self.getContentElement().style.border=<span class="literal">"none"</span>;}}});};Zapatec.Pane.<span class="reserved">prototype</span>.setPaneContent=<span class="reserved">function</span>(content,type){<span class="reserved">if</span>(!content&amp;&amp;content!==<span class="literal">""</span>){content=<span class="reserved">this</span>.config.source;}
<span class="reserved">if</span>(!type){type=<span class="reserved">this</span>.config.sourceType;}
<span class="reserved">this</span>.config.source=content;<span class="reserved">this</span>.config.sourceType=type;var self=<span class="reserved">this</span>;<span class="reserved">if</span>(<span class="reserved">this</span>.config.showLoadingIndicator){<span class="reserved">this</span>.showIndicator();<span class="reserved">this</span>.loading=true;}
<span class="reserved">if</span>(<span class="reserved">this</span>.config.containerType.toLowerCase()==<span class="literal">"iframe"</span>&amp;&amp;type==<span class="literal">"html/url"</span>){<span class="reserved">this</span>.ready=false;<span class="reserved">this</span>.fireWhenReady(<span class="reserved">function</span>(){<span class="reserved">if</span>(self.getContentElement()){try{var newWidth=self.getContentElement().scrollWidth;var newHeight=self.getContentElement().scrollHeight;<span class="reserved">if</span>(self.config.autoContentWidth){self.setWidth(newWidth);}
<span class="reserved">if</span>(self.config.autoContentHeight){self.setHeight(newHeight);}}catch(e){}}
self.fireEvent(<span class="literal">"contentLoaded"</span>,self);<span class="reserved">if</span>(self.events[<span class="literal">"contentLoaded"</span>]){self.events[<span class="literal">"contentLoaded"</span>].listeners=[];}});<span class="reserved">this</span>.getContainer().src=content;setTimeout(<span class="reserved">function</span>(){self.initPane()},50);<span class="reserved">return</span> true;}
<span class="reserved">if</span>(<span class="reserved">this</span>.config.containerType.toLowerCase()==<span class="literal">"iframe"</span>&amp;&amp;<span class="reserved">this</span>.getContainer().src.indexOf((Zapatec.zapatecPath+<span class="literal">"pane_files/blank.html#"</span>+<span class="reserved">this</span>.id).replace(/\.\.\<span class="comment">//g,""))&lt;0){this.ready=false;this.getContainer().src=Zapatec.zapatecPath+"pane_files/blank.html#"+this.id;}</span>
<span class="reserved">this</span>.loadData();<span class="reserved">return</span> true;};Zapatec.Pane.<span class="reserved">prototype</span>.show=<span class="reserved">function</span>(){<span class="reserved">this</span>.getContainer().style.display=<span class="literal">""</span>;<span class="reserved">if</span>(<span class="reserved">this</span>.loading){<span class="reserved">this</span>.showIndicator();}};Zapatec.Pane.<span class="reserved">prototype</span>.hide=<span class="reserved">function</span>(){<span class="reserved">this</span>.getContainer().style.display=<span class="literal">"none"</span>;<span class="reserved">if</span>(<span class="reserved">this</span>.loading){<span class="reserved">this</span>.hideIndicator();}};Zapatec.Pane.<span class="reserved">prototype</span>.showIndicator=<span class="reserved">function</span>(message){<span class="reserved">if</span>(Zapatec.Indicator){<span class="reserved">this</span>.hideIndicator();<span class="reserved">if</span>(!<span class="reserved">this</span>.loader){<span class="reserved">this</span>.loader=new Zapatec.Indicator({container:<span class="reserved">this</span>.container,themePath:Zapatec.zapatecPath+<span class="literal">"../zpextra/themes/indicator/"</span>});}
<span class="reserved">this</span>.loader.start(message||<span class="literal">'loading'</span>);}};Zapatec.Pane.<span class="reserved">prototype</span>.hideIndicator=<span class="reserved">function</span>(){<span class="reserved">if</span>(<span class="reserved">this</span>.loader&amp;&amp;<span class="reserved">this</span>.loader.isActive()){<span class="reserved">this</span>.loader.stop();}};Zapatec.Pane.<span class="reserved">prototype</span>.fireWhenReady=<span class="reserved">function</span>(func){<span class="reserved">if</span>(!<span class="reserved">this</span>.isReady()){<span class="reserved">this</span>.addEventListener(<span class="literal">"onReady"</span>,func);}<span class="reserved">else</span>{func.call(<span class="reserved">this</span>,<span class="reserved">this</span>);}}
Zapatec.Pane.<span class="reserved">prototype</span>.destroy=<span class="reserved">function</span>(){<span class="reserved">if</span>(!<span class="reserved">this</span>.config){<span class="reserved">return</span>;}
<span class="reserved">this</span>.hideIndicator();<span class="reserved">this</span>.contentElement=null;<span class="reserved">this</span>.iframeDocument=null;<span class="reserved">if</span>(Zapatec.is_ie&amp;&amp;<span class="reserved">this</span>.config.containerType.toLowerCase()==<span class="literal">'iframe'</span>){<span class="reserved">this</span>.container.src=<span class="literal">"javascript:void(0)"</span>;}
<span class="reserved">if</span>(<span class="reserved">this</span>.container.outerHTML){<span class="reserved">this</span>.container.outerHTML=<span class="literal">""</span>;}<span class="reserved">else</span>{Zapatec.Utils.destroy(<span class="reserved">this</span>.container);}
<span class="reserved">this</span>.container=null;<span class="reserved">this</span>.ready=false;<span class="reserved">this</span>.prepared=false;}
Zapatec.Tab=<span class="reserved">function</span>(objArgs){<span class="reserved">if</span>(arguments.length==0){objArgs={};}
Zapatec.Tab.SUPERconstructor.call(<span class="reserved">this</span>,objArgs);};Zapatec.Tab.id=<span class="literal">'Zapatec.Tab'</span>;Zapatec.inherit(Zapatec.Tab,Zapatec.Widget);Zapatec.Tab.<span class="reserved">prototype</span>.init=<span class="reserved">function</span>(objArgs){Zapatec.Tab.SUPERclass.init.call(<span class="reserved">this</span>,objArgs);<span class="reserved">this</span>.createTab();};Zapatec.Tab.<span class="reserved">prototype</span>.createTab=<span class="reserved">function</span>(){<span class="reserved">this</span>.createProperty(<span class="reserved">this</span>,<span class="literal">'linkNode'</span>,null);<span class="reserved">this</span>.createProperty(<span class="reserved">this</span>,<span class="literal">'container'</span>,null);<span class="reserved">this</span>.createProperty(<span class="reserved">this</span>,<span class="literal">'focusOn'</span>,null);<span class="reserved">this</span>.createProperty(<span class="reserved">this</span>,<span class="literal">'linkHash'</span>,null);<span class="reserved">this</span>.createProperty(<span class="reserved">this</span>,<span class="literal">'pendingOnTabChange'</span>,null);<span class="reserved">this</span>.container=new Zapatec.Pane({containerType:<span class="reserved">this</span>.config.tabType,parent:<span class="reserved">this</span>.config.tabParent,overflow:<span class="reserved">this</span>.config.overflow,id:<span class="reserved">this</span>.config.id});<span class="reserved">this</span>.container.removeBorder();var className=<span class="literal">"zpTab"</span>;<span class="reserved">if</span>(<span class="reserved">this</span>.config.className){className+=<span class="literal">" "</span>+<span class="reserved">this</span>.config.className;}
<span class="reserved">this</span>.container.getContainer().className=className;var self=<span class="reserved">this</span>;var onContentLoaded=<span class="reserved">function</span>(){<span class="reserved">if</span>(self.pendingOnTabChange){self.pendingOnTabChange(self);self.pendingOnTabChange=null;}
self.fireEvent(<span class="literal">'tabOnLoad'</span>);setTimeout(<span class="reserved">function</span>(){self.container.addEventListener(<span class="literal">'contentLoaded'</span>,self.onContentLoaded);},10);}
<span class="reserved">this</span>.createProperty(<span class="reserved">this</span>,<span class="literal">'onContentLoaded'</span>,onContentLoaded);<span class="reserved">this</span>.container.addEventListener(<span class="literal">'contentLoaded'</span>,onContentLoaded);<span class="reserved">this</span>.container.hide();<span class="reserved">if</span>(<span class="reserved">this</span>.config.contentType!=<span class="literal">"html/url"</span>){<span class="reserved">this</span>.setPaneContent();}
<span class="reserved">else</span>{<span class="reserved">if</span>(<span class="reserved">this</span>.config.shouldLoadOnInit){<span class="reserved">this</span>.setPaneContent();}}
<span class="reserved">if</span>(<span class="reserved">this</span>.config.id){<span class="reserved">this</span>.id=<span class="reserved">this</span>.config.id;}
<span class="reserved">else</span>{<span class="reserved">this</span>.id=<span class="reserved">this</span>.container.getContainer().getAttribute(<span class="literal">'id'</span>);<span class="reserved">if</span>(typeof <span class="reserved">this</span>.id==<span class="literal">'string'</span>){<span class="reserved">this</span>.container.getContainer().removeAttribute(<span class="literal">'id'</span>);}}
<span class="reserved">if</span>(typeof <span class="reserved">this</span>.id!=<span class="literal">'string'</span>||!<span class="reserved">this</span>.id.length){<span class="reserved">this</span>.id=Zapatec.Utils.generateID(<span class="literal">'tab'</span>);}
<span class="reserved">this</span>.linkNode=Zapatec.Utils.createElement(<span class="literal">'div'</span>);<span class="reserved">this</span>.linkNode.onmouseover=<span class="reserved">function</span>(){var outer=Zapatec.Utils.getFirstChild(self.linkNode,<span class="literal">"div"</span>);Zapatec.Utils.addClass(outer,<span class="literal">"zpTabsHover"</span>);}
<span class="reserved">this</span>.linkNode.onmouseout=<span class="reserved">function</span>(){var outer=Zapatec.Utils.getFirstChild(self.linkNode,<span class="literal">"div"</span>);Zapatec.Utils.removeClass(outer,<span class="literal">"zpTabsHover"</span>);}
<span class="reserved">this</span>.linkNode.className=<span class="literal">"zpTab"</span>;<span class="reserved">this</span>.linkNode.name=<span class="reserved">this</span>.id;var innerClass=<span class="literal">"zpTabLinkInner"</span>;<span class="reserved">if</span>(<span class="reserved">this</span>.config.closable){innerClass+=<span class="literal">" zpTabClosable"</span>;}
var innerHtml=<span class="literal">'&lt;div class="zpTabLinkOuter"&gt;&lt;div class="'</span>+innerClass+<span class="literal">'"&gt;'</span>+<span class="literal">'&lt;div class="zpTabAnchorHolder"&gt;&lt;a '</span>;<span class="reserved">if</span>(<span class="reserved">this</span>.config.accessKey){innerHtml+=<span class="literal">'accessKey="'</span>+<span class="reserved">this</span>.config.accessKey+<span class="literal">'" '</span>;}
<span class="reserved">if</span>(<span class="reserved">this</span>.config.title){innerHtml+=<span class="literal">'title="'</span>+<span class="reserved">this</span>.config.title+<span class="literal">'" '</span>;}
innerHtml+=<span class="literal">'&gt;'</span>+<span class="reserved">this</span>.config.linkInnerHTML+<span class="literal">'&lt;/a&gt;&lt;/div&gt;'</span>;<span class="reserved">if</span>(<span class="reserved">this</span>.config.closable){var closeUrl=<span class="reserved">this</span>.config.themePath+<span class="reserved">this</span>.config.theme+<span class="literal">"/close.gif"</span>;var closeImgHtml=<span class="literal">'&lt;img class="zpTabClose" border=0 src="'</span>+closeUrl+<span class="literal">'"&gt;'</span>;innerHtml+=closeImgHtml;}
innerHtml+=<span class="literal">'&lt;div class="zpTabsClearer"&gt;&lt;/div&gt;'</span>;innerHtml+=<span class="literal">'&lt;/div&gt;&lt;/div&gt;'</span>;<span class="reserved">this</span>.linkNode.innerHTML=innerHtml;var closeImages=<span class="reserved">this</span>.linkNode.getElementsByTagName(<span class="literal">'img'</span>);<span class="reserved">if</span>(closeImages&amp;&amp;0&lt;closeImages.length&amp;&amp;self.config.closeAction!=<span class="literal">'none'</span>){closeImages[0].onmousedown=<span class="reserved">function</span>(ev){Zapatec.Tab.CloseTab(self.config.tabsId,self.id);Zapatec.Utils.stopEvent(ev);<span class="reserved">return</span> false;}}
<span class="reserved">this</span>.onActivate=<span class="reserved">function</span>(e){<span class="reserved">if</span>(self.lastActivateTime){var diff=new Date().getTime()-self.lastActivateTime;<span class="reserved">if</span>(diff&lt;300){<span class="reserved">return</span>;}}
self.lastActivateTime=new Date().getTime();self.fireEvent(<span class="literal">'activateTab'</span>);<span class="reserved">if</span>(self.blur){self.blur();}
var doNavigate=false;<span class="reserved">if</span>(self.config.changeUrl){<span class="reserved">if</span>(Zapatec.is_khtml){doNavigate=true;}
<span class="reserved">else</span>{window.location.hash=self.linkHash;}}
Zapatec.Utils.stopEvent(e);<span class="reserved">return</span> doNavigate;};<span class="reserved">if</span>(<span class="reserved">this</span>.config.mouseOverChangesTab){<span class="reserved">this</span>.linkNode.onmouseover=<span class="reserved">this</span>.onActivate;}
<span class="reserved">else</span>{<span class="reserved">this</span>.linkNode.onmousedown=<span class="reserved">this</span>.onActivate;}
<span class="reserved">if</span>(Zapatec.is_webkit){<span class="reserved">this</span>.linkNode.onclick=<span class="reserved">this</span>.onActivate;}
<span class="reserved">this</span>.linkNode.tabIndex=Zapatec.Tab.tabIndex;<span class="reserved">if</span>(!<span class="reserved">this</span>.tab2tab){Zapatec.Tab.tabIndex+=2;}
<span class="reserved">this</span>.linkNode.onfocus=<span class="reserved">this</span>.onActivate;<span class="reserved">this</span>.linkNode.onkeydown=<span class="reserved">function</span>(ev){ev||(ev=window.event);switch(ev.keyCode){case 13:case 32:<span class="reserved">if</span>(self.focusOn&amp;&amp;self.focusOn.focus){self.focusOn.focus();}
<span class="reserved">return</span> false;}
<span class="reserved">return</span> true;}
<span class="reserved">if</span>(<span class="reserved">this</span>.container.getContainer().hasChildNodes()){<span class="reserved">this</span>.getFocusOn();}}
Zapatec.Tab.<span class="reserved">prototype</span>.setLinkHash=<span class="reserved">function</span>(linkHash){<span class="reserved">this</span>.linkHash=linkHash;<span class="reserved">this</span>.linkNode.setAttribute(<span class="literal">'href'</span>,<span class="literal">'#'</span>+linkHash);}
Zapatec.Tab.<span class="reserved">prototype</span>.configure=<span class="reserved">function</span>(objArgs){<span class="reserved">this</span>.defineConfigOption(<span class="literal">'id'</span>,null);<span class="reserved">this</span>.defineConfigOption(<span class="literal">'index'</span>,-1);<span class="reserved">this</span>.defineConfigOption(<span class="literal">'linkInnerHTML'</span>,<span class="literal">''</span>);<span class="reserved">this</span>.defineConfigOption(<span class="literal">'accessKey'</span>,<span class="literal">''</span>);<span class="reserved">this</span>.defineConfigOption(<span class="literal">'content'</span>,null);<span class="reserved">this</span>.defineConfigOption(<span class="literal">'contentType'</span>,null);<span class="reserved">this</span>.defineConfigOption(<span class="literal">'url'</span>,<span class="literal">''</span>);<span class="reserved">this</span>.defineConfigOption(<span class="literal">'tabType'</span>,<span class="literal">"div"</span>);<span class="reserved">this</span>.defineConfigOption(<span class="literal">'tab2tab'</span>,false);<span class="reserved">this</span>.defineConfigOption(<span class="literal">'tabParent'</span>,null);<span class="reserved">this</span>.defineConfigOption(<span class="literal">'title'</span>,null);<span class="reserved">this</span>.defineConfigOption(<span class="literal">'closable'</span>,false);<span class="reserved">this</span>.defineConfigOption(<span class="literal">'closeAction'</span>,<span class="literal">'close'</span>);<span class="reserved">this</span>.defineConfigOption(<span class="literal">'changeUrl'</span>,true);<span class="reserved">this</span>.defineConfigOption(<span class="literal">'overflow'</span>,null);<span class="reserved">this</span>.defineConfigOption(<span class="literal">'mouseOverChangesTab'</span>,false);<span class="reserved">this</span>.defineConfigOption(<span class="literal">'refreshOnTabChange'</span>,false);<span class="reserved">this</span>.defineConfigOption(<span class="literal">'shouldLoadOnInit'</span>,false);<span class="reserved">this</span>.defineConfigOption(<span class="literal">'tabsId'</span>,null);<span class="reserved">this</span>.defineConfigOption(<span class="literal">'visible'</span>,true);<span class="reserved">this</span>.defineConfigOption(<span class="literal">'className'</span>,null);<span class="reserved">this</span>.defineConfigOption(<span class="literal">'langId'</span>,Zapatec.Tabs.id);<span class="reserved">this</span>.defineConfigOption(<span class="literal">'lang'</span>,<span class="literal">"eng"</span>);Zapatec.Tab.SUPERclass.configure.call(<span class="reserved">this</span>,objArgs);<span class="reserved">if</span>(typeof(<span class="reserved">this</span>.config.tabParent)==<span class="literal">"undefined"</span>){<span class="reserved">this</span>.initLang();Zapatec.Log({description:<span class="reserved">this</span>.getMessage(<span class="literal">"unknownTabParentError"</span>)})
<span class="reserved">return</span> false;}
<span class="reserved">if</span>(<span class="reserved">this</span>.config.tab2tab&amp;&amp;false!=<span class="reserved">this</span>.config.tab2tab){<span class="reserved">this</span>.config.tab2tab=true;}
<span class="reserved">if</span>(typeof <span class="reserved">this</span>.config.tabType==<span class="literal">"string"</span>){<span class="reserved">this</span>.config.tabType=<span class="reserved">this</span>.config.tabType.toLowerCase();}
<span class="reserved">if</span>(<span class="reserved">this</span>.config.tabType!=<span class="literal">"div"</span>&amp;&amp;<span class="reserved">this</span>.config.tabType!=<span class="literal">"iframe"</span>)
{<span class="reserved">this</span>.config.tabType=<span class="literal">"div"</span>;}
<span class="reserved">if</span>(<span class="reserved">this</span>.config.index&lt;0){<span class="reserved">this</span>.config.index=-1;}};Zapatec.Tab.tabIndex=1000;Zapatec.Tab.<span class="reserved">prototype</span>.getFocusOn=<span class="reserved">function</span>(){<span class="reserved">this</span>.focusOn=null;<span class="reserved">if</span>(<span class="reserved">this</span>.tab2tab){<span class="reserved">return</span>;}
var self=<span class="reserved">this</span>;setTimeout(<span class="reserved">function</span>(){var iTabIndex=0;<span class="reserved">function</span> parse(objNode){var objChild=objNode.firstChild;<span class="reserved">while</span>(objChild){<span class="reserved">if</span>(objChild.nodeType==1){var strTag=objChild.tagName.toLowerCase();<span class="reserved">if</span>(strTag==<span class="literal">'a'</span>||strTag==<span class="literal">'input'</span>||strTag==<span class="literal">'select'</span>||strTag==<span class="literal">'textarea'</span>||strTag==<span class="literal">'button'</span>){<span class="reserved">if</span>(!self.focusOn){self.focusOn=objChild;}
<span class="reserved">else</span> <span class="reserved">if</span>(objChild.tabIndex&amp;&amp;objChild.tabIndex&gt;0&amp;&amp;(!iTabIndex||iTabIndex&gt;objChild.tabIndex)){self.focusOn=objChild;iTabIndex=objChild.tabIndex;}
<span class="reserved">if</span>(!objChild.tabIndex){objChild.tabIndex=self.linkNode.tabIndex+1;}}
parse(objChild);}
objChild=objChild.nextSibling;}};parse(self.container);},0);};Zapatec.Tab.<span class="reserved">prototype</span>.setInnerHtml=<span class="reserved">function</span>(strHtml){Zapatec.Transport.setInnerHtml({html:strHtml,container:<span class="reserved">this</span>.container.getContainer()});<span class="reserved">this</span>.getFocusOn();}
Zapatec.Tab.<span class="reserved">prototype</span>.setPaneContent=<span class="reserved">function</span>(content,type){var self=<span class="reserved">this</span>;var paneContent=null;var paneContentType=null;<span class="reserved">if</span>(content){paneContent=content;paneContentType=type;}
<span class="reserved">else</span> <span class="reserved">if</span>(<span class="reserved">this</span>.config.url&amp;&amp;0&lt;<span class="reserved">this</span>.config.url.length){paneContent=<span class="reserved">this</span>.config.url;paneContentType=<span class="literal">'html/url'</span>;}
<span class="reserved">else</span>{paneContent=<span class="reserved">this</span>.config.content;paneContentType=<span class="reserved">this</span>.config.contentType;}
<span class="reserved">if</span>(paneContent){<span class="reserved">this</span>.config.content=content;<span class="reserved">this</span>.config.contentType=type;<span class="reserved">if</span>(paneContentType==<span class="literal">"html/url"</span>){<span class="reserved">this</span>.config.url=paneContent;<span class="reserved">this</span>.lastUrlSet=paneContent;}
<span class="reserved">this</span>.container.setPaneContent(paneContent,paneContentType);}}
Zapatec.Tab.<span class="reserved">prototype</span>.setVisible=<span class="reserved">function</span>(isVisible){<span class="reserved">this</span>.config.visible=isVisible;<span class="reserved">if</span>(isVisible){<span class="reserved">this</span>.linkNode.style.display=<span class="literal">'block'</span>;}
<span class="reserved">else</span>{<span class="reserved">this</span>.linkNode.style.display=<span class="literal">'none'</span>;}}
Zapatec.Tab.CloseTab=<span class="reserved">function</span>(tabsId,id){var objTabs=Zapatec.Widget.getWidgetById(tabsId);var objTab=objTabs.getTab(id);<span class="reserved">if</span>(objTab.config.closeAction==<span class="literal">'close'</span>){objTabs.removeTab(id);}
<span class="reserved">else</span> <span class="reserved">if</span>(objTab.config.closeAction==<span class="literal">'hide'</span>){var isRemovingCurrent=objTab.index==objTabs.currentIndex;<span class="reserved">if</span>(isRemovingCurrent){var previousTab=objTabs.getPreviousTab(true,objTabs.currentIndex);<span class="reserved">if</span>(previousTab){objTabs.changeTab(previousTab.id);}
<span class="reserved">else</span>{var nextTab=objTabs.getNextTab(true,objTabs.currentIndex);<span class="reserved">if</span>(nextTab){objTabs.changeTab(nextTab.id);}}}
objTab.setVisible(false);}
objTabs.fireEvent(<span class="literal">'tabOnClose'</span>,id);}
Zapatec.Tab.<span class="reserved">prototype</span>.renameTab=<span class="reserved">function</span>(linkInnerHTML,accessKey,title){var anchor=<span class="reserved">this</span>.linkNode.childNodes[0].childNodes[0].childNodes[0].childNodes[0];anchor.innerHTML=linkInnerHTML;<span class="reserved">if</span>(accessKey){anchor.accessKey=accessKey;}
<span class="reserved">if</span>(title){anchor.title=title;}}
Zapatec.Tabs=<span class="reserved">function</span>(objArgs){<span class="reserved">if</span>(arguments.length==0){objArgs={};}
Zapatec.Tabs.SUPERconstructor.call(<span class="reserved">this</span>,objArgs);};Zapatec.Tabs.id=<span class="literal">'Zapatec.Tabs'</span>;Zapatec.inherit(Zapatec.Tabs,Zapatec.Widget);Zapatec.Tabs.<span class="reserved">prototype</span>.init=<span class="reserved">function</span>(objArgs){Zapatec.Tabs.SUPERclass.init.call(<span class="reserved">this</span>,objArgs);<span class="reserved">this</span>.createTabs();<span class="reserved">this</span>.initTabBar();};Zapatec.Tabs.<span class="reserved">prototype</span>.createTabs=<span class="reserved">function</span>(){<span class="reserved">this</span>.createProperty(<span class="reserved">this</span>,<span class="literal">'tabs'</span>,{});<span class="reserved">this</span>.createProperty(<span class="reserved">this</span>,<span class="literal">'tabsArray'</span>,[]);<span class="reserved">if</span>(null==<span class="reserved">this</span>.tabsThemeSuffix){<span class="reserved">this</span>.tabsThemeSuffix=<span class="literal">'Content'</span>;}
Zapatec.Utils.addClass(<span class="reserved">this</span>.config.tabs,<span class="reserved">this</span>.getClassName({prefix:<span class="literal">'zpTabs'</span>,suffix:<span class="reserved">this</span>.tabsThemeSuffix}));<span class="reserved">this</span>.loadData();<span class="reserved">this</span>.currentIndex=-1;<span class="reserved">if</span>(typeof <span class="reserved">this</span>.config.onInit==<span class="literal">'function'</span>){<span class="reserved">this</span>.config.onInit();}
<span class="reserved">if</span>(<span class="reserved">this</span>.tabsArray.length){var strId=<span class="reserved">this</span>.getInitialActiveTabId();<span class="reserved">if</span>(-1!=strId&amp;&amp;!<span class="reserved">this</span>.config.collapseOnClick){<span class="reserved">this</span>.changeTab(strId);}}
<span class="reserved">if</span>(<span class="reserved">this</span>.config.windowOnLoad!=null)
{<span class="reserved">this</span>.config.windowOnLoad();}
<span class="reserved">if</span>(true!=<span class="reserved">this</span>.noTabBar){<span class="reserved">this</span>.addEventListener(<span class="literal">'loadThemeEnd'</span>,<span class="reserved">function</span>(){<span class="reserved">this</span>.config.tabBar.style.display=<span class="literal">'block'</span>;});}
<span class="reserved">this</span>.smallWidth=-1;}
Zapatec.Tabs.<span class="reserved">prototype</span>.configure=<span class="reserved">function</span>(objArgs){<span class="reserved">this</span>.defineConfigOption(<span class="literal">'tabBar'</span>,null);<span class="reserved">this</span>.defineConfigOption(<span class="literal">'tabs'</span>,null);<span class="reserved">this</span>.defineConfigOption(<span class="literal">'onInit'</span>,null);<span class="reserved">this</span>.defineConfigOption(<span class="literal">'onTabChange'</span>,null);<span class="reserved">this</span>.defineConfigOption(<span class="literal">'onBeforeTabChange'</span>,null);<span class="reserved">this</span>.defineConfigOption(<span class="literal">'ignoreUrl'</span>,false);<span class="reserved">this</span>.defineConfigOption(<span class="literal">'changeUrl'</span>,true);<span class="reserved">this</span>.defineConfigOption(<span class="literal">'tab2tab'</span>,false);<span class="reserved">this</span>.defineConfigOption(<span class="literal">'scrollMultiple'</span>,null);<span class="reserved">this</span>.defineConfigOption(<span class="literal">'iframeContent'</span>,null);<span class="reserved">this</span>.defineConfigOption(<span class="literal">'tabType'</span>,<span class="literal">'div'</span>);<span class="reserved">this</span>.defineConfigOption(<span class="literal">'windowOnLoad'</span>,null);<span class="reserved">this</span>.defineConfigOption(<span class="literal">'scrolls'</span>,false);<span class="reserved">this</span>.defineConfigOption(<span class="literal">'noMoreTabsLeft'</span>,false);<span class="reserved">this</span>.defineConfigOption(<span class="literal">'lastIndexLeft'</span>,0);<span class="reserved">this</span>.defineConfigOption(<span class="literal">'noMoreTabsRight'</span>,true);<span class="reserved">this</span>.defineConfigOption(<span class="literal">'lastIndexRight'</span>,null);<span class="reserved">this</span>.defineConfigOption(<span class="literal">'showEffect'</span>,null);<span class="reserved">this</span>.defineConfigOption(<span class="literal">'showEffectSpeed'</span>,null);<span class="reserved">this</span>.defineConfigOption(<span class="literal">'mouseOverChangesTab'</span>,false);<span class="reserved">this</span>.defineConfigOption(<span class="literal">'refreshOnTabChange'</span>,false);<span class="reserved">this</span>.defineConfigOption(<span class="literal">'overflow'</span>,null);<span class="reserved">this</span>.defineConfigOption(<span class="literal">'shouldLoadOnInit'</span>,false);<span class="reserved">this</span>.defineConfigOption(<span class="literal">'closable'</span>,false);<span class="reserved">this</span>.defineConfigOption(<span class="literal">'closeAction'</span>,<span class="literal">'close'</span>);<span class="reserved">this</span>.defineConfigOption(<span class="literal">'activeTabId'</span>,null);<span class="reserved">this</span>.defineConfigOption(<span class="literal">'langId'</span>,Zapatec.Tabs.id);<span class="reserved">this</span>.defineConfigOption(<span class="literal">'lang'</span>,<span class="literal">"eng"</span>);<span class="reserved">this</span>.defineConfigOption(<span class="literal">'minTabsFrom'</span>,null);<span class="reserved">this</span>.defineConfigOption(<span class="literal">'minWidth'</span>,<span class="literal">"20"</span>);<span class="reserved">if</span>(<span class="reserved">this</span>.config.scroll==null)
{<span class="reserved">this</span>.config.scrollMultiple=false;}
<span class="reserved">else</span> <span class="reserved">if</span>(<span class="reserved">this</span>.config.scrollMultiple!=true&amp;&amp;<span class="reserved">this</span>.config.scrollMultiple!=false)
{<span class="reserved">this</span>.config.scrollMultiple=false;}
Zapatec.Tabs.SUPERclass.configure.call(<span class="reserved">this</span>,objArgs);<span class="reserved">if</span>(true!=<span class="reserved">this</span>.noTabBar){<span class="reserved">this</span>.config.tabBar=Zapatec.Widget.getElementById(<span class="reserved">this</span>.config.tabBar);<span class="reserved">if</span>(!<span class="reserved">this</span>.config.tabBar){<span class="reserved">this</span>.initLang();Zapatec.Log({description:<span class="reserved">this</span>.getMessage(<span class="literal">"unknownTabBarError"</span>)});<span class="reserved">return</span>;}}
<span class="reserved">if</span>(<span class="literal">"string"</span>==typeof <span class="reserved">this</span>.config.tabs){<span class="reserved">this</span>.config.tabs=Zapatec.Widget.getElementById(<span class="reserved">this</span>.config.tabs);}
<span class="reserved">if</span>(!<span class="reserved">this</span>.config.tabs){<span class="reserved">this</span>.initLang();Zapatec.Log({description:<span class="reserved">this</span>.getMessage(<span class="literal">"unknownTabsError"</span>)});<span class="reserved">return</span>;}
<span class="reserved">if</span>(typeof <span class="reserved">this</span>.config.tabType==<span class="literal">"string"</span>){<span class="reserved">this</span>.config.tabType=<span class="reserved">this</span>.config.tabType.toLowerCase();}
<span class="reserved">if</span>(<span class="reserved">this</span>.config.tabType!=<span class="literal">"div"</span>&amp;&amp;objArgs.tabType!=<span class="literal">"iframe"</span>)
{<span class="reserved">this</span>.config.tabType=<span class="literal">"div"</span>;}
<span class="reserved">if</span>(true==<span class="reserved">this</span>.config.iframeContent){<span class="reserved">this</span>.config.tabType=<span class="literal">"iframe"</span>;}};Zapatec.Tabs.<span class="reserved">prototype</span>.initTabBar=<span class="reserved">function</span>(){<span class="reserved">if</span>(true==<span class="reserved">this</span>.noTabBar){<span class="reserved">return</span>;}
Zapatec.Utils.addClass(<span class="reserved">this</span>.config.tabBar,<span class="reserved">this</span>.getClassName({prefix:<span class="literal">'zpTabs'</span>}));var _tabBarContentWidth=0;var items=<span class="reserved">this</span>.config.tabBar.childNodes;var tmp=<span class="literal">''</span>;<span class="reserved">if</span>(<span class="reserved">this</span>.config.minTabsFrom&amp;&amp;0&lt;items.length){<span class="reserved">if</span>(<span class="reserved">this</span>.config.minWidth&gt;<span class="reserved">this</span>.smallWidth){<span class="reserved">this</span>.smallWidth=items[0].offsetWidth/(items.length-<span class="reserved">this</span>.config.minTabsFrom);}<span class="reserved">else</span>{<span class="reserved">this</span>.smallWidth=<span class="reserved">this</span>.config.minWidth;}}
<span class="reserved">for</span>(var i=0;i&lt;items.length;i++){<span class="reserved">if</span>(items[i].nodeType!=1){continue;}
tmp=items[i].style.position;items[i].style.position=<span class="literal">'absolute'</span>;items[i].originalDisplayType=items[i].style.display!=<span class="literal">''</span>?items[i].style.display:<span class="literal">'block'</span>;_tabBarContentWidth+=items[i].offsetWidth;items[i].realWidth=items[i].offsetWidth;items[i].style.display=<span class="literal">'none'</span>;items[i].style.position=tmp;items[i].arrayPosition=i;}
<span class="reserved">for</span>(var i=0;i&lt;items.length;i++)
{<span class="reserved">if</span>(items[i].nodeType!=1){continue;}
items[i].style.display=items[i].originalDisplayType;<span class="reserved">if</span>(-1&lt;<span class="reserved">this</span>.smallWidth&amp;&amp;<span class="reserved">this</span>.config.minTabsFrom-1&lt;=i){items[i].style.width=<span class="reserved">this</span>.smallWidth+<span class="literal">'px'</span>;items[i].style.overflow=<span class="literal">'hidden'</span>;}}
var _tabBarWidth=<span class="reserved">this</span>.config.tabBar.offsetWidth;<span class="reserved">if</span>(_tabBarContentWidth&gt;_tabBarWidth)
{<span class="reserved">this</span>.config.scrolls=true;var tmp=0;var i=0;<span class="reserved">while</span>(tmp&lt;_tabBarWidth)tmp+=items[i++].realWidth;i--;<span class="reserved">for</span>(i;i&lt;items.length;i++)
{items[i].style.display=<span class="literal">'none'</span>;}
var _leftScrolly=Zapatec.Utils.createElement(<span class="literal">'div'</span>);_leftScrolly.innerHTML=<span class="literal">'&amp;lt;'</span>;var _rightScrolly=Zapatec.Utils.createElement(<span class="literal">'div'</span>);_rightScrolly.innerHTML=<span class="literal">'&amp;gt;'</span>;var self=<span class="reserved">this</span>;_rightScrolly.onclick=(<span class="reserved">this</span>.config.scrollMultiple)?<span class="reserved">function</span>(){self.scrollTabsLeft(true)}:<span class="reserved">function</span>(){self.scrollOneTabLeft(true)};_leftScrolly.onclick=(<span class="reserved">this</span>.config.scrollMultiple)?<span class="reserved">function</span>(){self.scrollTabsRight(true)}:<span class="reserved">function</span>(){self.scrollOneTabRight(true)};var mouseoverFunc=<span class="reserved">function</span>()
{<span class="reserved">this</span>.style.color=<span class="literal">'black'</span>;}
_leftScrolly.onmouseover=mouseoverFunc;_rightScrolly.onmouseover=mouseoverFunc;var mouseoutFunc=<span class="reserved">function</span>()
{<span class="reserved">this</span>.style.color=<span class="literal">'#aaa'</span>;}
_leftScrolly.onmouseout=mouseoutFunc;_rightScrolly.onmouseout=mouseoutFunc;var _scrollyContainer=Zapatec.Utils.createElement(<span class="literal">'div'</span>);_scrollyContainer.className=<span class="literal">'zpTabsScrolly'</span>;_scrollyContainer.appendChild(_leftScrolly);_scrollyContainer.appendChild(_rightScrolly);<span class="reserved">if</span>(<span class="reserved">this</span>.config.scrollMultiple)
{<span class="reserved">this</span>.config.tabBar.parentNode.insertBefore(_scrollyContainer,<span class="reserved">this</span>.config.tabBar.nextSibling);}}}
Zapatec.Tabs.<span class="reserved">prototype</span>.addToTabBar=<span class="reserved">function</span>(objTab){<span class="reserved">if</span>(true==<span class="reserved">this</span>.noTabBar){<span class="reserved">return</span>;}
var configIndex=objTab.config.index;var insertBefore=null;<span class="reserved">if</span>(-1!=configIndex){var actualIndex=objTab.index;var children=<span class="reserved">this</span>.config.tabBar.childNodes;var childrenCount=children.length;<span class="reserved">if</span>(0&lt;childrenCount&amp;&amp;actualIndex&lt;childrenCount){insertBefore=children[actualIndex];}}
<span class="reserved">if</span>(!insertBefore){var lastTab=<span class="reserved">this</span>.getPreviousTab(true,objTab.index);<span class="reserved">if</span>(lastTab){Zapatec.Utils.removeClass(lastTab.linkNode,<span class="literal">'zpTabsLast'</span>);}
<span class="reserved">this</span>.config.tabBar.appendChild(objTab.linkNode);Zapatec.Utils.addClass(objTab.linkNode,<span class="literal">'zpTabsLast'</span>);<span class="reserved">if</span>(1==<span class="reserved">this</span>.tabsArray.length){Zapatec.Utils.addClass(objTab.linkNode,<span class="literal">'zpTabsFirst'</span>);}}
<span class="reserved">else</span>{<span class="reserved">if</span>(0==objTab.index){Zapatec.Utils.addClass(objTab.linkNode,<span class="literal">'zpTabsFirst'</span>);var nextTab=<span class="reserved">this</span>.getNextTab(true,objTab.index);<span class="reserved">if</span>(nextTab){Zapatec.Utils.removeClass(nextTab.linkNode,<span class="literal">'zpTabsFirst'</span>);}}
<span class="reserved">this</span>.config.tabBar.insertBefore(objTab.linkNode,insertBefore);}
<span class="reserved">if</span>(<span class="reserved">this</span>.config.minTabsFrom){<span class="reserved">if</span>(<span class="reserved">this</span>.config.minTabsFrom&lt;<span class="reserved">this</span>.config.tabBar.childNodes.length){<span class="reserved">this</span>.smallWidth=objTab.linkNode.offsetWidth/(<span class="reserved">this</span>.config.tabBar.childNodes.length-<span class="reserved">this</span>.config.minTabsFrom);<span class="reserved">if</span>(<span class="reserved">this</span>.config.minWidth&gt;<span class="reserved">this</span>.smallWidth){<span class="reserved">this</span>.smallWidth=<span class="reserved">this</span>.config.minWidth;}
<span class="reserved">for</span>(var i=<span class="reserved">this</span>.config.minTabsFrom-1;i&lt;<span class="reserved">this</span>.config.tabBar.childNodes.length;i++){<span class="reserved">if</span>(<span class="reserved">this</span>.config.tabBar.childNodes[i].style){<span class="reserved">this</span>.config.tabBar.childNodes[i].style.width=<span class="reserved">this</span>.smallWidth+<span class="literal">'px'</span>;<span class="reserved">this</span>.config.tabBar.childNodes[i].style.overflow=<span class="literal">'hidden'</span>;}}}}
<span class="reserved">if</span>(!objTab.config.visible){objTab.linkNode.style.display=<span class="literal">'none'</span>;}}
Zapatec.Tabs.<span class="reserved">prototype</span>.attachTab=<span class="reserved">function</span>(objTab){var index=objTab.config.index;<span class="reserved">if</span>(<span class="reserved">this</span>.tabsArray.length&lt;=index){index=-1;}
<span class="reserved">if</span>(-1==index){objTab.index=<span class="reserved">this</span>.tabsArray.length;}
<span class="reserved">else</span>{objTab.index=index;<span class="reserved">for</span>(var i=<span class="reserved">this</span>.tabsArray.length-1;index&lt;=i;--i){var oldTab=<span class="reserved">this</span>.tabsArray[i];oldTab.index=oldTab.index+1;<span class="reserved">this</span>.tabsArray[i+1]=oldTab;}
<span class="reserved">if</span>(index&lt;=<span class="reserved">this</span>.currentIndex){++<span class="reserved">this</span>.currentIndex;}}
<span class="reserved">this</span>.tabsArray[objTab.index]=objTab;<span class="reserved">this</span>.tabs[objTab.id]=objTab;var linkHash=<span class="reserved">this</span>.config.tabs.id+<span class="literal">"="</span>+objTab.id;objTab.setLinkHash(linkHash);var self=<span class="reserved">this</span>;objTab.addEventListener(<span class="literal">"activateTab"</span>,<span class="reserved">function</span>(){self.changeTab(objTab.id);});}
Zapatec.Tabs.<span class="reserved">prototype</span>.scrollOneTabLeft=<span class="reserved">function</span>(setTab){var tabBar=<span class="reserved">this</span>.config.tabBar;var items=tabBar.childNodes;var i=0;<span class="reserved">for</span>(i;i&lt;items.length;i++)
{<span class="reserved">if</span>(items[i].style.display!=<span class="literal">'none'</span>)
{break;}}
var j=i;<span class="reserved">for</span>(j;j&lt;items.length;j++)
{<span class="reserved">if</span>(items[j].style.display==<span class="literal">'none'</span>)
{break;}}
<span class="reserved">if</span>(j&gt;=items.length)
{<span class="reserved">return</span>;}
items[i].style.display=<span class="literal">'none'</span>;<span class="reserved">if</span>(j&lt;items.length)
{items[j].style.display=items[j].originalDisplayType;}}
Zapatec.Tabs.<span class="reserved">prototype</span>.scrollOneTabRight=<span class="reserved">function</span>(setTab){var tabBar=<span class="reserved">this</span>.config.tabBar;var items=tabBar.childNodes;var i=0;<span class="reserved">for</span>(i;i&lt;items.length;i++)
{<span class="reserved">if</span>(items[i].style.display!=<span class="literal">'none'</span>)
{break;}}
<span class="reserved">if</span>(i==0)
{<span class="reserved">return</span>;}
var j=i;<span class="reserved">for</span>(j;j&lt;items.length;j++)
{<span class="reserved">if</span>(items[j].style.display==<span class="literal">'none'</span>)
{break;}}
items[j-1].style.display=<span class="literal">'none'</span>;items[i-1].style.display=items[i-1].originalDisplayType;}
Zapatec.Tabs.<span class="reserved">prototype</span>.scrollTabsLeft=<span class="reserved">function</span>(setTab){<span class="reserved">if</span>(<span class="reserved">this</span>.config.noMoreTabsLeft)
{<span class="reserved">return</span>;}
<span class="reserved">this</span>.config.noMoreTabsRight=false;<span class="reserved">if</span>(!<span class="reserved">this</span>.config.tabBar)
{<span class="reserved">return</span>;}
var tabBar=<span class="reserved">this</span>.config.tabBar;var contentWidth=parseInt(tabBar.style.width);var items=tabBar.childNodes;var i=<span class="reserved">this</span>.config.lastIndexLeft-1;<span class="reserved">while</span>(++i&lt;items.length)
{<span class="reserved">if</span>(items[i].style.display!=<span class="literal">'none'</span>)
{items[i].style.display=<span class="literal">'none'</span>;}
<span class="reserved">else</span>
{<span class="reserved">this</span>.config.lastIndexLeft=i;break;}}
var contentWidth=0;var tabBarWidth=parseInt(tabBar.style.width);<span class="reserved">for</span>(i=<span class="reserved">this</span>.config.lastIndexLeft;i&lt;items.length;i++)
{items[i].style.display=items[i].originalDisplayType;contentWidth+=items[i].realWidth;<span class="reserved">if</span>(contentWidth&gt;tabBarWidth)
{items[i].style.display=<span class="literal">'none'</span>;<span class="reserved">this</span>.config.lastIndexRight=i-1;<span class="reserved">if</span>(setTab)
{<span class="reserved">this</span>.changeTab(items[<span class="reserved">this</span>.config.lastIndexLeft].name);}
<span class="reserved">return</span>;}}
<span class="reserved">this</span>.config.lastIndexRight=i-1;<span class="reserved">if</span>(setTab)
{<span class="reserved">this</span>.changeTab(items[<span class="reserved">this</span>.config.lastIndexLeft].name);}
<span class="reserved">this</span>.config.noMoreTabsLeft=true;}
Zapatec.Tabs.<span class="reserved">prototype</span>.scrollTabsRight=<span class="reserved">function</span>(setTab){<span class="reserved">if</span>(<span class="reserved">this</span>.config.noMoreTabsRight)
{<span class="reserved">return</span>;}
<span class="reserved">this</span>.config.noMoreTabsLeft=false;<span class="reserved">if</span>(!<span class="reserved">this</span>.config.tabBar)
{<span class="reserved">return</span>;}
var tabBar=<span class="reserved">this</span>.config.tabBar;var contentWidth=parseInt(tabBar.style.width);var items=tabBar.childNodes;var i=<span class="reserved">this</span>.config.lastIndexRight+1;<span class="reserved">while</span>(--i&gt;=0)
{<span class="reserved">if</span>(items[i].style.display!=<span class="literal">'none'</span>)
{items[i].style.display=<span class="literal">'none'</span>;}
<span class="reserved">else</span>
{<span class="reserved">this</span>.config.lastIndexRight=i;break;}}
var contentWidth=0;var tabBarWidth=parseInt(tabBar.style.width);<span class="reserved">for</span>(i=<span class="reserved">this</span>.config.lastIndexRight;i&gt;=0;i--)
{items[i].style.display=items[i].originalDisplayType;contentWidth+=items[i].realWidth;<span class="reserved">if</span>(contentWidth&gt;tabBarWidth)
{items[i].style.display=<span class="literal">'none'</span>;<span class="reserved">this</span>.config.lastIndexLeft=i+1;<span class="reserved">if</span>(setTab)
{<span class="reserved">this</span>.changeTab(items[<span class="reserved">this</span>.config.lastIndexRight].name);}
<span class="reserved">return</span>;}}
<span class="reserved">this</span>.config.lastIndexLeft=i+1;<span class="reserved">if</span>(setTab)
{<span class="reserved">this</span>.changeTab(items[<span class="reserved">this</span>.config.lastIndexRight].name);}
<span class="reserved">this</span>.config.noMoreTabsRight=true;}
Zapatec.Tabs.<span class="reserved">prototype</span>.loadDataJson=<span class="reserved">function</span>(objSource){<span class="reserved">if</span>((true!=<span class="reserved">this</span>.noTabBar&amp;&amp;!<span class="reserved">this</span>.config.tabBar)||!<span class="reserved">this</span>.config.tabs){<span class="reserved">return</span>;}
<span class="reserved">if</span>(!objSource||!objSource.tabs||!objSource.tabs.length){<span class="reserved">return</span>;}
var iLen=objSource.tabs.length;<span class="reserved">for</span>(var iTab=0;iTab&lt;iLen;iTab++){var objTabDef=objSource.tabs[iTab];<span class="reserved">this</span>.addTab(objTabDef);}};Zapatec.Tabs.<span class="reserved">prototype</span>.newTab=<span class="reserved">function</span>(objArgs){var objTab=new Zapatec.Tab(objArgs);<span class="reserved">return</span> objTab;}
Zapatec.Tabs.<span class="reserved">prototype</span>.loadDataHtml=<span class="reserved">function</span>(objSource){<span class="reserved">if</span>((true!=<span class="reserved">this</span>.noTabBar&amp;&amp;!<span class="reserved">this</span>.config.tabBar)||!<span class="reserved">this</span>.config.tabs){<span class="reserved">return</span>;}
<span class="reserved">if</span>(!objSource){objSource=<span class="reserved">this</span>.config.tabs;}
var childs=[];<span class="reserved">for</span>(var ii=0;ii&lt;objSource.childNodes.length;ii++){childs.push(objSource.childNodes[ii]);}
<span class="reserved">for</span>(var iChild=0;iChild&lt;childs.length;iChild++){var objChild=childs[iChild];<span class="reserved">if</span>(objChild.nodeType==1){var objLabel=Zapatec.Utils.getFirstChild(objChild,<span class="literal">'label'</span>);<span class="reserved">if</span>(!objLabel){continue;}
objLabel.parentNode.removeChild(objLabel);objChild.parentNode.removeChild(objChild);var objArgs={tabParent:<span class="reserved">this</span>.config.tabs,id:objChild.getAttribute(<span class="literal">'id'</span>),linkInnerHTML:objLabel.innerHTML,accessKey:objLabel.getAttribute(<span class="literal">'accesskey'</span>),title:objLabel.getAttribute(<span class="literal">'title'</span>),content:objChild,tabType:objChild.getAttribute(<span class="literal">'tabType'</span>),url:objChild.getAttribute(<span class="literal">'url'</span>),className:objChild.className,overflow:objChild.style.overflow,visible:objLabel.style.display!=<span class="literal">"none"</span>,refreshOnTabChange:objChild.getAttribute(<span class="literal">'refreshOnTabChange'</span>),closable:objLabel.getAttribute(<span class="literal">'closable'</span>),closeAction:objLabel.getAttribute(<span class="literal">'closeAction'</span>)};var objTab=<span class="reserved">this</span>.addTab(objArgs);<span class="reserved">if</span>(objTab.id){objTab.container.getContainer().setAttribute(<span class="literal">'id'</span>,objTab.id);objChild.removeAttribute(<span class="literal">'id'</span>);}}}
<span class="reserved">this</span>.isLoadedHtml=true;};Zapatec.Tabs.<span class="reserved">prototype</span>.addTab=<span class="reserved">function</span>(objTabDef){<span class="reserved">if</span>((true!=<span class="reserved">this</span>.noTabBar&amp;&amp;!<span class="reserved">this</span>.config.tabBar)||!<span class="reserved">this</span>.config.tabs){<span class="reserved">return</span>;}
<span class="reserved">if</span>(!objTabDef){<span class="reserved">return</span>;}
<span class="reserved">if</span>(!objTabDef.tabType){objTabDef.tabType=<span class="reserved">this</span>.config.tabType;}
objTabDef.tabParent=<span class="reserved">this</span>.config.tabs;objTabDef.changeUrl=<span class="reserved">this</span>.config.changeUrl;<span class="reserved">if</span>(!objTabDef.lang){objTabDef.lang=<span class="reserved">this</span>.config.lang;}
<span class="reserved">if</span>(!objTabDef.mouseOverChangesTab){objTabDef.mouseOverChangesTab=<span class="reserved">this</span>.config.mouseOverChangesTab;}
<span class="reserved">if</span>(!objTabDef.refreshOnTabChange){objTabDef.refreshOnTabChange=<span class="reserved">this</span>.config.refreshOnTabChange;}
<span class="reserved">if</span>(!objTabDef.shouldLoadOnInit){objTabDef.shouldLoadOnInit=<span class="reserved">this</span>.config.shouldLoadOnInit;}
<span class="reserved">if</span>(!objTabDef.overflow&amp;&amp;<span class="literal">''</span>!=objTabDef.overflow){objTabDef.overflow=<span class="reserved">this</span>.config.overflow;}
<span class="reserved">if</span>(!objTabDef.closable){objTabDef.closable=<span class="reserved">this</span>.config.closable;}
<span class="reserved">if</span>(!objTabDef.closeAction){objTabDef.closeAction=<span class="reserved">this</span>.config.closeAction;}
objTabDef.theme=<span class="reserved">this</span>.config.theme;objTabDef.themePath=<span class="reserved">this</span>.config.themePath;objTabDef.tabsId=<span class="reserved">this</span>.id;var objTab=<span class="reserved">this</span>.newTab(objTabDef);<span class="reserved">if</span>(objTab.id){objTabDef.id=objTab.id;}
var index=objTabDef.index;<span class="reserved">this</span>.attachTab(objTab);<span class="reserved">this</span>.addToTabBar(objTab);<span class="reserved">return</span> objTab;};Zapatec.Tabs.<span class="reserved">prototype</span>.removeTab=<span class="reserved">function</span>(strTabId){var objTab=<span class="reserved">this</span>.getTab(strTabId);<span class="reserved">if</span>(!objTab){<span class="reserved">return</span>;}
var isRemovingCurrent=objTab.index==<span class="reserved">this</span>.currentIndex;var newCurrentIndex=<span class="reserved">this</span>.currentIndex;<span class="reserved">if</span>(objTab.index&lt;=<span class="reserved">this</span>.currentIndex){newCurrentIndex=<span class="reserved">this</span>.currentIndex-1;}
<span class="reserved">if</span>(0==objTab.index){Zapatec.Utils.removeClass(objTab.linkNode,<span class="literal">'zpTabsFirst'</span>);var nextTab=<span class="reserved">this</span>.getNextTab(true,0);<span class="reserved">if</span>(nextTab){Zapatec.Utils.addClass(nextTab.linkNode,<span class="literal">'zpTabsFirst'</span>);}}
<span class="reserved">else</span> <span class="reserved">if</span>(<span class="reserved">this</span>.tabsArray.length-1==objTab.index){Zapatec.Utils.removeClass(objTab.linkNode,<span class="literal">'zpTabsLast'</span>);var prevTab=<span class="reserved">this</span>.getPreviousTab(true,objTab.index);<span class="reserved">if</span>(prevTab){Zapatec.Utils.addClass(prevTab.linkNode,<span class="literal">'zpTabsLast'</span>);}}
<span class="reserved">this</span>.config.tabBar.removeChild(objTab.linkNode);<span class="reserved">this</span>.tabs[strTabId]=null;var newTabsArray=[];var toIndex=0;<span class="reserved">for</span>(var fromIndex=0;fromIndex&lt;<span class="reserved">this</span>.tabsArray.length;++fromIndex){var fromTab=<span class="reserved">this</span>.tabsArray[fromIndex];<span class="reserved">if</span>(objTab.index!=fromTab.index){fromTab.index=toIndex;newTabsArray[toIndex]=fromTab;++toIndex;}}
<span class="reserved">this</span>.tabsArray=newTabsArray;var container=objTab.container.getContainer();objTab.container.getContainer().parentNode.removeChild(objTab.container.getContainer());<span class="reserved">if</span>(newCurrentIndex&lt;0&amp;&amp;0&lt;<span class="reserved">this</span>.tabsArray.length){newCurrentIndex=0;}
<span class="reserved">if</span>(isRemovingCurrent){<span class="reserved">this</span>.currentIndex=-1;<span class="reserved">if</span>(-1!=newCurrentIndex&amp;&amp;newCurrentIndex&lt;<span class="reserved">this</span>.tabsArray.length){<span class="reserved">this</span>.changeTab(<span class="reserved">this</span>.tabsArray[newCurrentIndex].id);}}
<span class="reserved">this</span>.currentIndex=newCurrentIndex;<span class="reserved">if</span>(<span class="reserved">this</span>.config.minTabsFrom&amp;&amp;0&lt;newCurrentIndex){var objTab=<span class="reserved">this</span>.getTab(<span class="reserved">this</span>.config.tabBar.childNodes[<span class="reserved">this</span>.currentIndex].name);<span class="reserved">this</span>.smallWidth=objTab.linkNode.offsetWidth/(<span class="reserved">this</span>.config.tabBar.childNodes.length-<span class="reserved">this</span>.config.minTabsFrom);<span class="reserved">if</span>(<span class="reserved">this</span>.config.minWidth&gt;<span class="reserved">this</span>.smallWidth){<span class="reserved">this</span>.smallWidth=<span class="reserved">this</span>.config.minWidth;}
<span class="reserved">for</span>(var i=0;i&lt;<span class="reserved">this</span>.config.minTabsFrom-1;i++){<span class="reserved">if</span>(<span class="reserved">this</span>.config.tabBar.childNodes[i]&amp;&amp;<span class="reserved">this</span>.config.tabBar.childNodes[i].style){<span class="reserved">this</span>.config.tabBar.childNodes[i].style.width=<span class="literal">'auto'</span>;}}
<span class="reserved">for</span>(var i=<span class="reserved">this</span>.config.minTabsFrom-1;i&lt;<span class="reserved">this</span>.config.tabBar.childNodes.length;i++){<span class="reserved">if</span>(<span class="reserved">this</span>.config.tabBar.childNodes[i]&amp;&amp;<span class="reserved">this</span>.config.tabBar.childNodes[i].style&amp;&amp;i!=<span class="reserved">this</span>.currentIndex){<span class="reserved">this</span>.config.tabBar.childNodes[i].style.width=<span class="reserved">this</span>.smallWidth+<span class="literal">'px'</span>;<span class="reserved">this</span>.config.tabBar.childNodes[i].style.overflow=<span class="literal">'hidden'</span>;}}}}
Zapatec.Tabs.<span class="reserved">prototype</span>.changeTab=<span class="reserved">function</span>(strNewTabId){var strCurrTabId=null;var objTab=null;<span class="reserved">if</span>(<span class="reserved">this</span>.tabsArray[<span class="reserved">this</span>.currentIndex]){strCurrTabId=<span class="reserved">this</span>.tabsArray[<span class="reserved">this</span>.currentIndex].id;objTab=<span class="reserved">this</span>.tabsArray[<span class="reserved">this</span>.currentIndex];}
<span class="reserved">if</span>(strCurrTabId!=strNewTabId){var boolChangeTab=true;<span class="reserved">if</span>(typeof <span class="reserved">this</span>.config.onBeforeTabChange==<span class="literal">'function'</span>){boolChangeTab=<span class="reserved">this</span>.config.onBeforeTabChange({oldTabId:strCurrTabId,newTabId:strNewTabId});}
<span class="reserved">if</span>(!boolChangeTab){<span class="reserved">if</span>(objTab&amp;&amp;objTab.linkNode.focus){objTab.linkNode.focus();setTimeout(<span class="reserved">function</span>(){<span class="reserved">if</span>(objTab.focusOn&amp;&amp;objTab.focusOn.focus){objTab.focusOn.focus();}},0);}
<span class="reserved">return</span>;}
<span class="reserved">if</span>(<span class="reserved">this</span>.config.scrolls)
{var _newTab=<span class="reserved">this</span>.tabsArray[<span class="reserved">this</span>.tabs[strNewTabId].index].linkNode;<span class="reserved">if</span>(<span class="reserved">this</span>.tabsArray[<span class="reserved">this</span>.currentIndex])
{var _curTab=<span class="reserved">this</span>.tabsArray[<span class="reserved">this</span>.currentIndex].linkNode;}
<span class="reserved">else</span>
{var _curTab=<span class="reserved">this</span>.tabsArray[0].linkNode;}
<span class="reserved">if</span>(_curTab.arrayPosition&lt;_newTab.arrayPosition)
{<span class="reserved">if</span>(<span class="reserved">this</span>.config.scrollMultiple)
{<span class="reserved">while</span>(_newTab.style.display==<span class="literal">'none'</span>)
{<span class="reserved">this</span>.scrollTabsLeft(false);}}
<span class="reserved">else</span>
{<span class="reserved">while</span>(_newTab.style.display==<span class="literal">'none'</span>)
{<span class="reserved">this</span>.scrollOneTabLeft(false);}}}
<span class="reserved">else</span> <span class="reserved">if</span>(_curTab.arrayPosition&gt;_newTab.arrayPosition)
{<span class="reserved">if</span>(<span class="reserved">this</span>.config.scrollMultiple)
{<span class="reserved">while</span>(_newTab.style.display==<span class="literal">'none'</span>)
{<span class="reserved">this</span>.scrollTabsRight(false);}}
<span class="reserved">else</span>
{<span class="reserved">while</span>(_newTab.style.display==<span class="literal">'none'</span>)
{<span class="reserved">this</span>.scrollOneTabRight(false);}}}}
<span class="reserved">if</span>(objTab){objTab.container.hide();<span class="reserved">if</span>(<span class="reserved">this</span>.config.minTabsFrom&amp;&amp;<span class="reserved">this</span>.config.minTabsFrom&lt;=objTab.index+1){objTab.linkNode.style.width=<span class="reserved">this</span>.smallWidth+<span class="literal">'px'</span>;objTab.linkNode.style.overflow=<span class="literal">'hidden'</span>;}
objTab.lastActivateTime=0;Zapatec.Utils.removeClass(objTab.linkNode,<span class="literal">'zpTabsActive'</span>);}
objTab=<span class="reserved">this</span>.tabs[strNewTabId];<span class="reserved">if</span>(objTab){<span class="reserved">if</span>(<span class="reserved">this</span>.config.minTabsFrom&amp;&amp;<span class="reserved">this</span>.config.minTabsFrom&lt;=objTab.index+1){objTab.linkNode.style.width=<span class="literal">'auto'</span>;objTab.linkNode.style.overflow=<span class="literal">'auto'</span>;}
<span class="reserved">if</span>(!<span class="reserved">this</span>.config.showEffect){objTab.container.show();}
<span class="reserved">else</span>{Zapatec.Effects.init(objTab.container.getContainer(),true,<span class="reserved">this</span>.config.showEffectSpeed,<span class="reserved">this</span>.config.showEffect);}
<span class="reserved">if</span>(<span class="reserved">this</span>.config.refreshOnTabChange)
{var iframes=objTab.container.getContainer().getElementsByTagName(<span class="literal">'iframe'</span>);<span class="reserved">for</span>(var i=0;i&lt;iframes.length;i++)
{window.parent.frames[iframes[i].name].location.reload(true)}}
<span class="reserved">if</span>(!objTab.config.visible){objTab.setVisible(true);}
Zapatec.Utils.addClass(objTab.linkNode,<span class="literal">'zpTabsActive'</span>);<span class="reserved">this</span>.currentIndex=objTab.index;<span class="reserved">this</span>.refreshTab(objTab,strCurrTabId,strNewTabId);}}};Zapatec.Tabs.<span class="reserved">prototype</span>.refreshTab=<span class="reserved">function</span>(objTab,strCurrTabId,strNewTabId){var url=null;<span class="reserved">if</span>(objTab.config.contentType==<span class="literal">"html/url"</span>){url=objTab.config.content;}
<span class="reserved">else</span>{url=objTab.config.url;}
<span class="reserved">if</span>(typeof <span class="reserved">this</span>.config.onTabChange==<span class="literal">'function'</span>){var self=<span class="reserved">this</span>;objTab.pendingOnTabChange=<span class="reserved">function</span>(){self.config.onTabChange({oldTabId:strCurrTabId,newTabId:strNewTabId});}}
<span class="reserved">if</span>(url){var isIframeDiffSrc=objTab.config.tabType==<span class="literal">'iframe'</span>&amp;&amp;objTab.lastUrlSet!=url;var isEmptyDiv=objTab.config.tabType==<span class="literal">'div'</span>&amp;&amp;!objTab.container.getContainer().childNodes.length&amp;&amp;!<span class="reserved">this</span>.config.shouldLoadOnInit;<span class="reserved">if</span>(Zapatec.is_ie){var tabContents=objTab.container.getContainer().childNodes;<span class="reserved">if</span>(objTab.config.tabType==<span class="literal">'div'</span>&amp;&amp;1==tabContents.length){var el=tabContents[0];<span class="reserved">if</span>(1==el.nodeType&amp;&amp;el.id&amp;&amp;el.id.match(/wch/gi)){isEmptyDiv=true;}}}
<span class="reserved">if</span>(isEmptyDiv||isIframeDiffSrc||objTab.config.refreshOnTabChange){objTab.setPaneContent(url,<span class="literal">'html/url'</span>);<span class="reserved">return</span>;}}
<span class="reserved">else</span>{<span class="reserved">if</span>(!url){objTab.setPaneContent();}}
<span class="reserved">if</span>(objTab.pendingOnTabChange){objTab.pendingOnTabChange(self);objTab.pendingOnTabChange=null;}}
Zapatec.Tabs.<span class="reserved">prototype</span>.getTab=<span class="reserved">function</span>(tabId){var objTab=<span class="reserved">this</span>.tabs[tabId];<span class="reserved">return</span> objTab;};Zapatec.Tabs.<span class="reserved">prototype</span>.getTabByIndex=<span class="reserved">function</span>(tabIndex){var objTab=<span class="reserved">this</span>.tabsArray[tabIndex];<span class="reserved">return</span> objTab;};Zapatec.Tabs.<span class="reserved">prototype</span>.getNextTab=<span class="reserved">function</span>(isVisible,tabIndex){var nextTabIndex=tabIndex+1;<span class="reserved">while</span>(nextTabIndex&lt;<span class="reserved">this</span>.tabsArray.length){var objTab=<span class="reserved">this</span>.tabsArray[nextTabIndex];<span class="reserved">if</span>(objTab.config.visible==isVisible){<span class="reserved">return</span> objTab;}
++nextTabIndex;}
<span class="reserved">return</span> null;}
Zapatec.Tabs.<span class="reserved">prototype</span>.getPreviousTab=<span class="reserved">function</span>(isVisible,tabIndex){var previousTabIndex=tabIndex-1;<span class="reserved">while</span>(0&lt;=previousTabIndex){var objTab=<span class="reserved">this</span>.tabsArray[previousTabIndex];<span class="reserved">if</span>(objTab.config.visible==isVisible){<span class="reserved">return</span> objTab;}
--previousTabIndex;}
<span class="reserved">return</span> null;}
Zapatec.Tabs.<span class="reserved">prototype</span>.nextTab=<span class="reserved">function</span>(){var nextTab=<span class="reserved">this</span>.getNextTab(true,<span class="reserved">this</span>.currentIndex);<span class="reserved">if</span>(nextTab){<span class="reserved">this</span>.changeTab(nextTab.id);}
<span class="reserved">else</span>{nextTab=<span class="reserved">this</span>.getNextTab(true,-1);<span class="reserved">if</span>(nextTab){<span class="reserved">this</span>.changeTab(nextTab.id);}}};Zapatec.Tabs.<span class="reserved">prototype</span>.prevTab=<span class="reserved">function</span>(){var previousTab=<span class="reserved">this</span>.getPreviousTab(true,<span class="reserved">this</span>.currentIndex);<span class="reserved">if</span>(previousTab){<span class="reserved">this</span>.changeTab(previousTab.id);}
<span class="reserved">else</span>{previousTab=<span class="reserved">this</span>.getPreviousTab(true,<span class="reserved">this</span>.tabsArray.length);<span class="reserved">if</span>(previousTab){<span class="reserved">this</span>.changeTab(previousTab.id);}}};Zapatec.Tabs.<span class="reserved">prototype</span>.firstTab=<span class="reserved">function</span>(){<span class="reserved">this</span>.changeTab(<span class="reserved">this</span>.tabsArray[0].id);};Zapatec.Tabs.<span class="reserved">prototype</span>.lastTab=<span class="reserved">function</span>(){<span class="reserved">this</span>.changeTab(<span class="reserved">this</span>.tabsArray[<span class="reserved">this</span>.tabsArray.length-1].id);};Zapatec.Tabs.<span class="reserved">prototype</span>.isFirstTab=<span class="reserved">function</span>(){<span class="reserved">return</span> <span class="reserved">this</span>.currentIndex==0;};Zapatec.Tabs.<span class="reserved">prototype</span>.isLastTab=<span class="reserved">function</span>(){<span class="reserved">return</span> <span class="reserved">this</span>.currentIndex==<span class="reserved">this</span>.tabsArray.length-1;};Zapatec.Tabs.<span class="reserved">prototype</span>.getInitialActiveTabId=<span class="reserved">function</span>(){var strId=null;<span class="reserved">if</span>(<span class="reserved">this</span>.config.activeTabId){strId=<span class="reserved">this</span>.config.activeTabId;}
<span class="reserved">else</span>{strId=<span class="reserved">this</span>.tabsArray[0].id;}
<span class="reserved">if</span>(!<span class="reserved">this</span>.config.ignoreUrl){var str=<span class="reserved">this</span>.config.tabs.id+<span class="literal">"="</span>;var url=document.URL;var pos=url.lastIndexOf(str);<span class="reserved">if</span>(-1!=pos){pos+=str.length;str=url.substring(pos);var tabId=str.split(<span class="literal">"&amp;"</span>)[0];<span class="reserved">if</span>(<span class="reserved">this</span>.tabs[tabId]){strId=tabId;}}}
<span class="reserved">return</span> strId;};Zapatec.TabsWizard=<span class="reserved">function</span>(objArgs){Zapatec.TabsWizard.SUPERconstructor.call(<span class="reserved">this</span>,objArgs);};Zapatec.TabsWizard.id=<span class="literal">'Zapatec.TabsWizard'</span>;Zapatec.inherit(Zapatec.TabsWizard,Zapatec.Tabs);Zapatec.TabsWizard.<span class="reserved">prototype</span>.init=<span class="reserved">function</span>(objArgs){<span class="reserved">this</span>.config.action=<span class="literal">''</span>;<span class="reserved">this</span>.config.submitTabId=<span class="literal">''</span>;<span class="reserved">this</span>.config.method=<span class="literal">''</span>;<span class="reserved">this</span>.config.contentType=<span class="literal">''</span>;<span class="reserved">this</span>.config.formThemePath=<span class="literal">''</span>;<span class="reserved">this</span>.config.formTheme=<span class="literal">''</span>;<span class="reserved">this</span>.config.formStatusImgPos=<span class="literal">''</span>;<span class="reserved">this</span>.config.showErrors=<span class="literal">''</span>;<span class="reserved">this</span>.config.onError=null;<span class="reserved">this</span>.config.onValid=null;<span class="reserved">this</span>.config.onSuccess=null;var objWizard=<span class="reserved">this</span>;var funcOnInit=objArgs.onInit;objArgs.onInit=<span class="reserved">function</span>(){var objHiddenForm=Zapatec.Utils.createElement(<span class="literal">'form'</span>);objHiddenForm.style.display=<span class="literal">'none'</span>;objHiddenForm.setAttribute(<span class="literal">'action'</span>,objWizard.config.action);objHiddenForm.setAttribute(<span class="literal">'method'</span>,objWizard.config.method);objHiddenForm.setAttribute(<span class="literal">'enctype'</span>,objWizard.config.contentType);objWizard.config.tabs.appendChild(objHiddenForm);objWizard.objHiddenForm=objHiddenForm;new Zapatec.Form({form:objHiddenForm,theme:objWizard.config.formTheme,submitErrorFunc:<span class="reserved">function</span>(objArgs){<span class="reserved">if</span>(typeof objWizard.config.onError!=<span class="literal">'function'</span>){<span class="reserved">return</span>;}
<span class="reserved">if</span>(objArgs.fieldErrors&amp;&amp;objArgs.fieldErrors.length){<span class="reserved">for</span>(var iTab=0;iTab&lt;objWizard.tabsArray.length;iTab++){var objTab=objWizard.tabsArray[iTab];<span class="reserved">if</span>(!objTab.form){continue;}
var arrFieldErrors=[];var objFields=objTab.formSource.elements;<span class="reserved">for</span>(var iField=0;iField&lt;objFields.length;iField++){var objField=objFields[iField];<span class="reserved">if</span>(!Zapatec.Form.Utils.isInputField(objField)){continue;}
var strName=objField.getAttribute(<span class="literal">'name'</span>);<span class="reserved">if</span>(!strName.length){continue;}
<span class="reserved">for</span>(var iFerr=0;iFerr&lt;objArgs.fieldErrors.length;iFerr++){<span class="reserved">if</span>(objArgs.fieldErrors[iFerr].field.name==strName){arrFieldErrors.push(objArgs.fieldErrors[iFerr]);break;}}}
<span class="reserved">if</span>(arrFieldErrors.length){objWizard.changeTab(objTab.id);break;}}}
<span class="reserved">else</span>{objWizard.changeTab(objWizard.tabsArray[0].id);}
objArgs.tabId=objWizard.tabsArray[objWizard.currentIndex].id;objWizard.config.onError(objArgs);},asyncSubmitFunc:objWizard.config.onSuccess});var funcOnBeforeTabChange=objWizard.config.onBeforeTabChange;objWizard.config.onBeforeTabChange=<span class="reserved">function</span>(objArgs){var iNewTabIndex=-1;<span class="reserved">for</span>(var iTab=0;iTab&lt;objWizard.tabsArray.length;iTab++){<span class="reserved">if</span>(objWizard.tabsArray[iTab].id==objArgs.newTabId){iNewTabIndex=iTab;break;}}
<span class="reserved">if</span>(iNewTabIndex&gt;objWizard.currentIndex){var objOldTab=objWizard.tabs[objArgs.oldTabId];<span class="reserved">if</span>(objOldTab&amp;&amp;objOldTab.form&amp;&amp;!objOldTab.form.submit()){<span class="reserved">return</span> false;}}
<span class="reserved">if</span>(objArgs.newTabId==objWizard.config.submitTabId){<span class="reserved">for</span>(var iTab=0;iTab&lt;objWizard.tabsArray.length;iTab++){var objTab=objWizard.tabsArray[iTab];<span class="reserved">if</span>(objTab.id==objArgs.newTabId){continue;}
<span class="reserved">if</span>(!objTab.parsed){objWizard.changeTab(objTab.id);<span class="reserved">return</span> false;}
<span class="reserved">if</span>(objTab.formSource){<span class="reserved">if</span>(!objTab.form||!objTab.form.submit()){objWizard.changeTab(objTab.id);<span class="reserved">return</span> false;}}}}
<span class="reserved">if</span>(typeof funcOnBeforeTabChange==<span class="literal">'function'</span>){<span class="reserved">return</span> funcOnBeforeTabChange(objArgs);}
<span class="reserved">return</span> true;};var funcOnTabChange=objWizard.config.onTabChange;objWizard.config.onTabChange=<span class="reserved">function</span>(objArgs){var strNewTabId=objArgs.newTabId;var objNewTab=objWizard.tabs[strNewTabId];<span class="reserved">if</span>(!objNewTab){<span class="reserved">return</span>;}
<span class="reserved">if</span>(!objNewTab.parsed){var objSource=objNewTab.container.getContentElement();var objForm=Zapatec.Utils.getFirstChild(objSource,<span class="literal">'form'</span>);<span class="reserved">if</span>(objForm&amp;&amp;objForm.className.indexOf(<span class="literal">'zpForm'</span>)&lt;0){<span class="reserved">while</span>(objForm=Zapatec.Utils.getNextSibling(objSource,<span class="literal">'form'</span>)){<span class="reserved">if</span>(objForm.className.indexOf(<span class="literal">'zpForm'</span>)&gt;=0){break;}}}
<span class="reserved">if</span>(objForm){objNewTab.formSource=objForm;}
objNewTab.parsed=true;}
<span class="reserved">if</span>(!objNewTab.form&amp;&amp;objNewTab.formSource){objNewTab.form=new Zapatec.Form({form:objNewTab.formSource,themePath:objWizard.config.formThemePath,theme:objWizard.config.formTheme,statusImgPos:objWizard.config.formStatusImgPos,showErrors:objWizard.config.showErrors,submitErrorFunc:<span class="reserved">function</span>(objArgs){objArgs.tabId=strNewTabId;<span class="reserved">if</span>(typeof objWizard.config.onError==<span class="literal">'function'</span>){objWizard.config.onError(objArgs);<span class="reserved">if</span>(objArgs.fieldErrors&amp;&amp;objArgs.fieldErrors.length){objNewTab.focusOn=objArgs.fieldErrors[0].field;}}},submitValidFunc:<span class="reserved">function</span>(){<span class="reserved">if</span>(typeof objWizard.config.onValid==<span class="literal">'function'</span>){objWizard.config.onValid({tabId:strNewTabId});}}});}
<span class="reserved">if</span>(strNewTabId==objWizard.config.submitTabId){<span class="reserved">function</span> addField(name,value,objHiddenForm){var objHiddenField=document.createElement(<span class="literal">'input'</span>);objHiddenField.setAttribute(<span class="literal">'type'</span>,<span class="literal">'hidden'</span>);objHiddenField.setAttribute(<span class="literal">'name'</span>,name);objHiddenForm.appendChild(objHiddenField);objHiddenField.setAttribute(<span class="literal">'value'</span>,value);}
objHiddenForm.innerHTML=<span class="literal">""</span>;<span class="reserved">for</span>(var iTab=0;iTab&lt;objWizard.tabsArray.length;iTab++){var objTab=objWizard.tabsArray[iTab];<span class="reserved">if</span>(!objTab.form){continue;}
var objForm=objTab.formSource;<span class="reserved">if</span>(!objForm){continue;}
var objFormElements=objForm.elements;<span class="reserved">for</span>(var iElm=0;iElm&lt;objFormElements.length;iElm++){var formEl=objFormElements[iElm];<span class="reserved">if</span>(!formEl.name||formEl.disabled){continue;}
<span class="reserved">if</span>(formEl.nodeName.toLowerCase()==<span class="literal">'input'</span>&amp;&amp;(formEl.type.toLowerCase()==<span class="literal">'radio'</span>||formEl.type.toLowerCase()==<span class="literal">'checkbox'</span>)&amp;&amp;!formEl.checked){continue;}
var val=Zapatec.Form.Utils.getValue(formEl);<span class="reserved">if</span>(val&amp;&amp;val instanceof Array){<span class="reserved">for</span>(var ii=0;ii&lt;val.length;ii++){addField(formEl.name,val[ii],objHiddenForm);}}<span class="reserved">else</span>{addField(formEl.name,val,objHiddenForm);}}}
objHiddenForm.onsubmit();}
<span class="reserved">if</span>(typeof funcOnTabChange==<span class="literal">'function'</span>){funcOnTabChange(objArgs);}};<span class="reserved">if</span>(typeof funcOnInit==<span class="literal">'function'</span>){funcOnInit(objArgs);}};Zapatec.TabsWizard.SUPERclass.init.call(<span class="reserved">this</span>,objArgs);};Zapatec.AccordionTab=<span class="reserved">function</span>(objArgs){<span class="reserved">if</span>(arguments.length==0){objArgs={};}
Zapatec.AccordionTab.SUPERconstructor.call(<span class="reserved">this</span>,objArgs);};Zapatec.AccordionTab.id=<span class="literal">'Zapatec.AccordionTab'</span>;Zapatec.inherit(Zapatec.AccordionTab,Zapatec.Tab);Zapatec.AccordionTab.<span class="reserved">prototype</span>.createTab=<span class="reserved">function</span>()
{<span class="reserved">this</span>.config.closable=false;var tabParent=<span class="reserved">this</span>.config.tabParent;<span class="reserved">this</span>.tabContainer=document.createElement(<span class="literal">'div'</span>);tabParent.appendChild(<span class="reserved">this</span>.tabContainer);<span class="reserved">this</span>.config.tabParent=<span class="reserved">this</span>.tabContainer;Zapatec.AccordionTab.SUPERclass.createTab.call(<span class="reserved">this</span>);<span class="reserved">this</span>.container.getContainer().style.display=<span class="literal">'block'</span>;<span class="reserved">this</span>.container.getContainer().style.width=<span class="literal">''</span>;<span class="reserved">this</span>.tabContainer.tabId=<span class="reserved">this</span>.id;<span class="reserved">this</span>.linkNode.tabIndex=Zapatec.AccordionTab.tabIndex;<span class="reserved">if</span>(<span class="reserved">this</span>.config.collapseOnClick){<span class="reserved">this</span>.linkNode.onfocus=null;}
<span class="reserved">if</span>(!<span class="reserved">this</span>.tab2tab)
{Zapatec.AccordionTab.tabIndex+=2;}
<span class="reserved">this</span>.chooser=Zapatec.Utils.createElement(<span class="literal">'div'</span>);<span class="reserved">this</span>.chooser.className=<span class="literal">'tabChooser'</span>;<span class="reserved">this</span>.chooser.onclick=<span class="reserved">this</span>.onActivate;<span class="reserved">this</span>.tabContainer.insertBefore(<span class="reserved">this</span>.chooser,<span class="reserved">this</span>.tabContainer.childNodes[0]);<span class="reserved">this</span>.chooser.appendChild(<span class="reserved">this</span>.linkNode);<span class="reserved">if</span>(<span class="reserved">this</span>.config.tabType!=<span class="literal">"iframe"</span>){<span class="reserved">this</span>.wch=Zapatec.Utils.createWCH(<span class="reserved">this</span>.container.getContainer());<span class="reserved">if</span>(<span class="reserved">this</span>.wch){<span class="reserved">this</span>.wch.style.zIndex=-1;}}};Zapatec.AccordionTab.<span class="reserved">prototype</span>.configure=<span class="reserved">function</span>(objArgs){<span class="reserved">this</span>.defineConfigOption(<span class="literal">'collapseOnClick'</span>,null);<span class="reserved">this</span>.defineConfigOption(<span class="literal">'visibleHeight'</span>,-1);Zapatec.AccordionTab.SUPERclass.configure.call(<span class="reserved">this</span>,objArgs);<span class="reserved">if</span>(<span class="reserved">this</span>.config.content&amp;&amp;1==<span class="reserved">this</span>.config.content.nodeType){<span class="reserved">this</span>.config.visibleHeight=parseInt(<span class="reserved">this</span>.config.content.style.height);<span class="reserved">this</span>.config.content.style.height=<span class="literal">""</span>;}}
Zapatec.AccordionTab.<span class="reserved">prototype</span>.getFocusOn=<span class="reserved">function</span>()
{<span class="reserved">this</span>.focusOn=null;<span class="reserved">if</span>(<span class="reserved">this</span>.tab2tab)
{<span class="reserved">return</span>;}
var self=<span class="reserved">this</span>;setTimeout(<span class="reserved">function</span>()
{var iTabIndex=0;<span class="reserved">function</span> parse(objNode)
{var objChild=objNode.firstChild;<span class="reserved">while</span>(objChild)
{<span class="reserved">if</span>(objChild.nodeType==1)
{var strTag=objChild.tagName.toLowerCase();<span class="reserved">if</span>(strTag==<span class="literal">'a'</span>||strTag==<span class="literal">'input'</span>||strTag==<span class="literal">'select'</span>||strTag==<span class="literal">'textarea'</span>||strTag==<span class="literal">'button'</span>)
{<span class="reserved">if</span>(!self.focusOn)
{self.focusOn=objChild;}
<span class="reserved">else</span> <span class="reserved">if</span>(objChild.tabIndex&amp;&amp;objChild.tabIndex&gt;0&amp;&amp;(!iTabIndex||iTabIndex&gt;objChild.tabIndex))
{self.focusOn=objChild;iTabIndex=objChild.tabIndex;}
<span class="reserved">if</span>(!objChild.tabIndex)
{objChild.tabIndex=self.linkNode.tabIndex+1;}}
parse(objChild);}
objChild=objChild.nextSibling;}};parse(self.container.getContainer());},0);};Zapatec.AccordionTabs=<span class="reserved">function</span>(objArgs){Zapatec.AccordionTabs.SUPERconstructor.call(<span class="reserved">this</span>,objArgs);};Zapatec.AccordionTabs.id=<span class="literal">'Zapatec.AccordionTabs'</span>;Zapatec.inherit(Zapatec.AccordionTabs,Zapatec.Tabs);Zapatec.AccordionTabs.<span class="reserved">prototype</span>.configure=<span class="reserved">function</span>(objArgs){<span class="reserved">this</span>.defineConfigOption(<span class="literal">'collapseOnClick'</span>,false);<span class="reserved">this</span>.defineConfigOption(<span class="literal">'scrollPageOnSlide'</span>,(Zapatec.is_ie&amp;&amp;!Zapatec.is_ie7)||Zapatec.is_gecko);Zapatec.AccordionTabs.SUPERclass.configure.call(<span class="reserved">this</span>,objArgs);}
Zapatec.AccordionTabs.<span class="reserved">prototype</span>.init=<span class="reserved">function</span>(objArgs,i)
{var self=<span class="reserved">this</span>;var funcOnInit=objArgs.onInit;objArgs.onInit=<span class="reserved">function</span>()
{var _tabContainer=self.config.tabs;var items=_tabContainer.childNodes;<span class="reserved">for</span>(var i=items.length-1;i&gt;=0;i--)
{var tagName=items[i].tagName;<span class="reserved">if</span>(tagName){tagName=tagName.toLowerCase();}
<span class="reserved">if</span>(<span class="literal">'div'</span>==tagName||<span class="literal">'iframe'</span>==tagName){self.config._tabArray.push(items[i]);}}
topPos=self.config._tabArray[self.config._tabArray.length-1].offsetTop;var _tabZIndex=100;<span class="reserved">for</span>(var i=0;i&lt;self.config._tabArray.length;i++)
{var tab=self.getTabByIndex(i);var tabContainer=tab.tabContainer;var contentContainer=tab.container.getContainer();var visibleHeight=tab.config.visibleHeight;<span class="reserved">if</span>(tab.config.tabType.toLowerCase()==<span class="literal">"iframe"</span>){tab.container.getContainer().style.width=<span class="literal">'100%'</span>;}
contentContainer.style.height=<span class="literal">'1px'</span>;Zapatec.Utils.addClass(contentContainer,<span class="literal">"zpTabsNoOverflow"</span>);tabContainer.style.width=_tabContainer.style.width;tabContainer.style.zIndex=_tabZIndex--;tabContainer.arrayPosition=i;tabContainer.viewingPosition=topPos+((self.config._tabArray.length-1-i)*self.config.tabBarHeight);tabContainer.hiddenPosition=topPos+parseInt(_tabContainer.style.height)-((i+1)*self.config.tabBarHeight);<span class="reserved">if</span>(visibleHeight&amp;&amp;0&lt;visibleHeight){tabContainer.viewingHeight=visibleHeight;}
<span class="reserved">else</span>{var tabContainerHeight=parseInt(_tabContainer.style.height);<span class="reserved">if</span>(tabContainerHeight&amp;&amp;0&lt;tabContainerHeight){tabContainer.viewingHeight=tabContainerHeight-
((self.config._tabArray.length)*self.config.tabBarHeight);}
<span class="reserved">else</span>{tabContainer.viewingHeight=100;}}
tabContainer.hiddenHeight=self.config.tabBarHeight;}
var activeTabId=self.getInitialActiveTabId();<span class="reserved">if</span>(-1!=activeTabId){var activeTab=self.getTab(activeTabId);var tabContainer=activeTab.tabContainer;var contentContainer=activeTab.container.getContainer();contentContainer.style.height=tabContainer.viewingHeight+<span class="literal">'px'</span>;Zapatec.Utils.addClass(activeTab.linkNode,<span class="literal">'zpTabsActive'</span>);var setOverflowFunc=<span class="reserved">function</span>(){Zapatec.Utils.removeClass(contentContainer,<span class="literal">"zpTabsNoOverflow"</span>);};<span class="reserved">if</span>(Zapatec.is_ie){setTimeout(setOverflowFunc,0);}
<span class="reserved">else</span>{setOverflowFunc();}
self.currentIndex=activeTab.index;self.refreshTab(activeTab,null,activeTabId);}
var funcOnBeforeTabChange=self.config.onBeforeTabChange;self.config.onBeforeTabChange=<span class="reserved">function</span>(objArgs)
{<span class="reserved">if</span>(typeof funcOnBeforeTabChange==<span class="literal">'function'</span>)
{<span class="reserved">return</span> funcOnBeforeTabChange(objArgs);}
<span class="reserved">return</span> true;};var funcOnTabChange=self.config.onTabChange;self.config.onTabChange=<span class="reserved">function</span>(objArgs)
{var strNewTabId=objArgs.newTabId;var objNewTab=self.tabs[strNewTabId];<span class="reserved">if</span>(!objNewTab)
{<span class="reserved">return</span>;}
<span class="reserved">if</span>(typeof funcOnTabChange==<span class="literal">'function'</span>)
{funcOnTabChange(objArgs);}};<span class="reserved">if</span>(typeof funcOnInit==<span class="literal">'function'</span>)
{funcOnInit(objArgs);}};<span class="reserved">this</span>.noTabBar=true;<span class="reserved">this</span>.config.windowOnLoad=null;<span class="reserved">this</span>.config._tabArray=new Array();<span class="reserved">this</span>.config.IN_MOTION=false;<span class="reserved">this</span>.config.tabBarHeight=24;<span class="reserved">this</span>.config.topPos=null;<span class="reserved">this</span>.config.indexOfWidget=i;<span class="reserved">this</span>.tabsThemeSuffix=<span class="literal">'AccordionContent'</span>;Zapatec.AccordionTabs.SUPERclass.init.call(<span class="reserved">this</span>,objArgs);}
Zapatec.AccordionTabs.<span class="reserved">prototype</span>.addTab=<span class="reserved">function</span>(objTabDef){<span class="reserved">if</span>(!objTabDef.collapseOnClick){objTabDef.collapseOnClick=<span class="reserved">this</span>.config.collapseOnClick;}
var objTab=Zapatec.AccordionTabs.SUPERclass.addTab.call(<span class="reserved">this</span>,objTabDef);objTab.tabContainer.index=objTab.index;<span class="reserved">return</span> objTab;}
Zapatec.AccordionTabs.<span class="reserved">prototype</span>.newTab=<span class="reserved">function</span>(objArgs){var objTab=new Zapatec.AccordionTab(objArgs);<span class="reserved">return</span> objTab;}
Zapatec.AccordionTabs.<span class="reserved">prototype</span>.changeTab=<span class="reserved">function</span>(strNewTabId){var strCurrTabId=null;var objTab=null;<span class="reserved">if</span>(<span class="reserved">this</span>.tabsArray[<span class="reserved">this</span>.currentIndex])
{strCurrTabId=<span class="reserved">this</span>.tabsArray[<span class="reserved">this</span>.currentIndex].id;objTab=<span class="reserved">this</span>.tabsArray[<span class="reserved">this</span>.currentIndex];}
<span class="reserved">if</span>(strCurrTabId!=strNewTabId&amp;&amp;!<span class="reserved">this</span>.config.IN_MOTION)
{var boolChangeTab=true;<span class="reserved">if</span>(typeof <span class="reserved">this</span>.config.onBeforeTabChange==<span class="literal">'function'</span>){boolChangeTab=<span class="reserved">this</span>.config.onBeforeTabChange({oldTabId:strCurrTabId,newTabId:strNewTabId});}
<span class="reserved">if</span>(!boolChangeTab){<span class="reserved">return</span>;}
<span class="reserved">if</span>(objTab)
{Zapatec.Utils.removeClass(objTab.linkNode,<span class="literal">'zpTabsActive'</span>);}
objTab=<span class="reserved">this</span>.getTab(strNewTabId);var oOffset=Zapatec.Utils.getElementOffset(<span class="reserved">this</span>.config.tabs);Zapatec.Utils.setupWCH(objTab.wch,0,0,oOffset.width,oOffset.height);Zapatec.Utils.addClass(objTab.linkNode,<span class="literal">'zpTabsActive'</span>);<span class="reserved">this</span>.currentIndex=objTab.index;<span class="reserved">this</span>.slide(objTab.tabContainer.arrayPosition,5,10);<span class="reserved">this</span>.refreshTab(objTab,strCurrTabId,strNewTabId);}
<span class="reserved">else</span>{<span class="reserved">if</span>(<span class="reserved">this</span>.config.collapseOnClick&amp;&amp;strCurrTabId==strNewTabId&amp;&amp;!<span class="reserved">this</span>.config.IN_MOTION){<span class="reserved">this</span>.collapseTab();}}};Zapatec.AccordionTabs.<span class="reserved">prototype</span>.slide=<span class="reserved">function</span>(index,pxInc,timeInc){<span class="reserved">if</span>(false==<span class="reserved">this</span>.config.IN_MOTION){var date=new Date();<span class="reserved">this</span>.moveStartTime=date.getTime();<span class="reserved">this</span>.lastTime=<span class="reserved">this</span>.moveStartTime-timeInc;<span class="reserved">this</span>.isDecreaseHeight=true;}
<span class="reserved">if</span>(isNaN(index)||index&lt;-1||index&gt;=<span class="reserved">this</span>.config._tabArray.length)
{<span class="reserved">this</span>.config.IN_MOTION=false;<span class="reserved">return</span>;}
var date=new Date();var time=date.getTime();var diffTime=time-<span class="reserved">this</span>.lastTime;var inc=Math.round((diffTime/timeInc)*pxInc);<span class="reserved">if</span>(0==inc){var self=<span class="reserved">this</span>;setTimeout(<span class="reserved">function</span>(){self.slide(index,pxInc,timeInc);},timeInc);<span class="reserved">return</span>;}
<span class="reserved">this</span>.lastTime=time;var resizeTabs={decreaseDif:0,increaseDif:0};var isAdjust=false;<span class="reserved">for</span>(var tries=0;tries&lt;2;tries++){<span class="reserved">for</span>(var i=0;i&lt;<span class="reserved">this</span>.config._tabArray.length;i++)
{var tab=<span class="reserved">this</span>.getTabByIndex(i);var tabContainer=tab.tabContainer;var contentContainer=tab.container.getContainer();var newHeight=-1;var oldHeight=parseInt(contentContainer.style.height);var isCurrent=tab.index==<span class="reserved">this</span>.currentIndex;<span class="reserved">if</span>(!isCurrent&amp;&amp;<span class="reserved">this</span>.isDecreaseHeight){newHeight=oldHeight-inc;<span class="reserved">if</span>(newHeight&lt;1){newHeight=1;}}
<span class="reserved">else</span> <span class="reserved">if</span>(isCurrent&amp;&amp;!<span class="reserved">this</span>.isDecreaseHeight){newHeight=oldHeight+inc;<span class="reserved">if</span>(tabContainer.viewingHeight&lt;=newHeight){newHeight=tabContainer.viewingHeight;}}
<span class="reserved">if</span>(-1!=newHeight&amp;&amp;oldHeight!=newHeight){<span class="reserved">if</span>(<span class="reserved">this</span>.isDecreaseHeight){resizeTabs.decreaseTab=contentContainer;resizeTabs.decreaseDif=oldHeight-newHeight;}
<span class="reserved">else</span>{resizeTabs.increaseTab=contentContainer;resizeTabs.increaseDif=newHeight-oldHeight;}
isAdjust=true;break;}}
<span class="reserved">this</span>.isDecreaseHeight=!<span class="reserved">this</span>.isDecreaseHeight;}
var dif;<span class="reserved">if</span>(resizeTabs.increaseTab&amp;&amp;resizeTabs.decreaseTab){dif=Math.min(resizeTabs.decreaseDif,resizeTabs.increaseDif);}
<span class="reserved">else</span> <span class="reserved">if</span>(!resizeTabs.increaseTab){dif=resizeTabs.decreaseDif;}
<span class="reserved">else</span>{dif=resizeTabs.increaseDif;}
var incTab=resizeTabs.increaseTab;var decTab=resizeTabs.decreaseTab;<span class="reserved">if</span>(incTab){var incOldHeight=parseInt(incTab.style.height);incTab.style.height=(incOldHeight+dif)+<span class="literal">'px'</span>;<span class="reserved">if</span>(<span class="reserved">this</span>.isLoadedHtml&amp;&amp;incTab.tagName&amp;&amp;incTab.tagName.toLowerCase()!=<span class="literal">'iframe'</span>){var tabContentDiv=Zapatec.Utils.getFirstChild(incTab,<span class="literal">"div"</span>);Zapatec.Utils.addClass(tabContentDiv,<span class="literal">"zpTabsNoOverflow"</span>);}
Zapatec.Utils.addClass(incTab,<span class="literal">"zpTabsNoOverflow"</span>);}
<span class="reserved">if</span>(decTab){var decOldHeight=parseInt(decTab.style.height);<span class="reserved">if</span>(!incTab&amp;&amp;<span class="reserved">this</span>.config.scrollPageOnSlide){var scrollY=Zapatec.Utils.getPageScrollY();var winSize=Zapatec.Utils.getWindowSize();var decTabPos=Zapatec.Utils.getAbsolutePos(decTab);var scrollPosBottom=scrollY+winSize.height-document.body.clientHeight;<span class="reserved">if</span>(0&lt;=scrollPosBottom&amp;&amp;scrollPosBottom&lt;20){var y=decTabPos.y+decOldHeight-winSize.height;<span class="reserved">if</span>(y&lt;0){y=0;}
window.scrollTo(0,y);}
<span class="reserved">if</span>(decTabPos.y+decOldHeight-dif&lt;scrollY){var y=decTabPos.y+decOldHeight-winSize.height;<span class="reserved">if</span>(y&lt;0){y=0;}
window.scrollTo(0,y);}}
decTab.style.height=(decOldHeight-dif)+<span class="literal">'px'</span>;<span class="reserved">if</span>(<span class="reserved">this</span>.isLoadedHtml&amp;&amp;decTab.tagName&amp;&amp;decTab.tagName.toLowerCase()!=<span class="literal">'iframe'</span>){var tabContentDiv=Zapatec.Utils.getFirstChild(decTab,<span class="literal">"div"</span>);Zapatec.Utils.addClass(tabContentDiv,<span class="literal">"zpTabsNoOverflow"</span>);}
Zapatec.Utils.addClass(decTab,<span class="literal">"zpTabsNoOverflow"</span>);}
<span class="reserved">if</span>(!isAdjust){<span class="reserved">this</span>.config.IN_MOTION=false;<span class="reserved">if</span>(-1!=<span class="reserved">this</span>.currentIndex){var currentTab=<span class="reserved">this</span>.getTabByIndex(<span class="reserved">this</span>.currentIndex);var stoppedTabContainer=currentTab.container.getContainer();Zapatec.Utils.removeClass(stoppedTabContainer,<span class="literal">"zpTabsNoOverflow"</span>);}
<span class="reserved">return</span>;}
<span class="reserved">this</span>.config.IN_MOTION=true;var self=<span class="reserved">this</span>;setTimeout(<span class="reserved">function</span>(){self.slide(index,pxInc,timeInc);},timeInc);}
Zapatec.AccordionTabs.<span class="reserved">prototype</span>.collapseTab=<span class="reserved">function</span>(){<span class="reserved">if</span>(-1!=<span class="reserved">this</span>.currentIndex){var currentTab=<span class="reserved">this</span>.getTabByIndex(<span class="reserved">this</span>.currentIndex);Zapatec.Utils.removeClass(currentTab.linkNode,<span class="literal">'zpTabsActive'</span>);}
<span class="reserved">this</span>.currentIndex=-1;<span class="reserved">this</span>.slide(-1,5,10);}</pre>
	<hr>



<!-- ========== START OF NAVBAR ========== -->
<a name="navbar_top"><!-- --></a>
<table border="0" width="100%" cellpadding="1" cellspacing="0">
<tr>
<td colspan=2 bgcolor="#EEEEFF" class="NavBarCell1">
<a name="navbar_top_firstrow"><!-- --></a>
<table border="0" cellpadding="0" cellspacing="3">
  <tr align="center" valign="top">
  
  
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="overview-summary.html"><font class="NavBarFont1"><b>Overview</b></font></a>&nbsp;</td>
  <td bgcolor="#FFFFFF" class="NavBarCell1Rev">	&nbsp;<font class="NavBarFont1Rev"><b>File</b></font>&nbsp;</td>
  

  <td bgcolor="#FFFFFF" class="NavBarCell1"> <font class="NavBarFont1">Class</font>&nbsp;</td>
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="overview-tree.html"><font class="NavBarFont1"><b>Tree</b></font></a>&nbsp;</td>
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="index-all.html"--><font class="NavBarFont1"><b>Index</b></font></a>&nbsp;</td>
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="help-doc.html"><font class="NavBarFont1"><b>Help</b></font></a>&nbsp;</td>
  </tr>
</table>
</td>
<td bgcolor="#EEEEFF" align="right" valign="top"><em>
<b>Zapatec Utils</b></em>
</td>
</tr>

<tr>
<td bgcolor="white" class="NavBarCell2"><font size="-2">
&nbsp;PREV&nbsp;
&nbsp;NEXT</font></td>
<td bgcolor="white" class="NavBarCell2"><font size="-2">
  <a href="index.html" target="_top"><b>FRAMES</b></a>  &nbsp;
&nbsp;<a href="overview-summary.html" target="_top"><b>NO FRAMES</b></a>
&nbsp;&nbsp;
<script>
  <!--
  if(window==top) {
    document.writeln('<A HREF="allclasses-noframe.html" TARGET=""><B>All Classes</B></A>');
  }
  //-->
</script>
<noscript>
<a href="allclasses-noframe.html" target=""><b>All Classes</b></a>
</noscript>
</font></td>
</tr>
</table>
<!-- =========== END OF NAVBAR =========== -->

<hr>
<font size="-1">

</font>
<div class="jsdoc_ctime">Documentation generated by <a href="http://jsdoc.sourceforge.net/" target="_parent">JSDoc</a> on Thu May 21 12:19:24 2009</div>
</body>
</html>
